Supersized PostgreSQL: Postgres-XL for Scale-Out OLTP and Big Data Analytics

M
1©2014 TransLattice, Inc. All Rights Reserved. 1
Supersized PostgreSQL:
Postgres-XL for Scale-out
OLTP and Big Data Analytics
June 17, 2014
Mason Sharp
2©2014 TransLattice, Inc. All Rights Reserved.
Agenda
•  Postgres-XL Background
•  Architecture Overview
•  Distributing Tables
•  Configuring a Local Cluster
•  Backup and Recovery
•  Differences to PostgreSQL and Postgres-XC
•  Community
3©2014 TransLattice, Inc. All Rights Reserved.
Announced May 2014
4©2014 TransLattice, Inc. All Rights Reserved.
Postgres-XL
n  Open Source
n  Scale-out RDBMS
–  Massive Parallel Processing
–  OLTP write and read scalability
–  Multi-tenant security
–  Cluster-wide ACID properties
–  Can also act as distributed key-value store
n  Mixed workloads, can eliminate need for separate
clusters in some cases
5©2014 TransLattice, Inc. All Rights Reserved.
XL Origins
Considered open sourcing very
early
6©2014 TransLattice, Inc. All Rights Reserved.
Postgres-XL Applications and
Use Case Examples
Postgres-XL Application Use Case Example
Business intelligence
requiring
MPP parallelism
Financial services big data
analysis of opportunities
across service lines
OLTP write-intensive
workloads
Online ad tracking
Mixed workload
environments
Real-time reporting on a
transactional system
8©2014 TransLattice, Inc. All Rights Reserved.
Postgres-XL Technology
•  Data is automatically
spread across cluster
•  Queries return back
data from all nodes in
parallel
•  The Global Transaction
Manager maintains a
consistent view of the
data across cluster
•  Connect to any
coordinator
9©2014 TransLattice, Inc. All Rights Reserved.
Postgres-XL Features
•  Multi Version Concurrency Control
•  Referential Integrity*
•  Full Text Search
•  Geo-spatial Functions and Data Types
•  JSON and XML Support
•  Distributed Key-Value Store
10©2014 TransLattice, Inc. All Rights Reserved.
Postgres-XL Missing Features
•  Built in High Availability
•  Use external like Corosync/Pacemaker
•  Area for future improvement
•  “Easy” to re-shard / add nodes
•  Some pieces there
•  Can however “pre-shard” multiple nodes on
the same server or VM
•  Some FK and UNIQUE constraints
11©2014 TransLattice, Inc. All Rights Reserved.
Postgres-XL Connectors
Looks like a PostgreSQL 9.2 database
•  C
•  C++
•  Perl
•  Python
•  PHP
•  Erlang
•  Haskell
– Java
– Javascript
– .NET
– Node.js
– Ruby
– Scala
13©2014 TransLattice, Inc. All Rights Reserved.
Performance
Transactional work loads
10 50 100 200 300 400
0
2000
4000
6000
8000
10000
12000
14000
16000
18000
Dell DVD Benchmark
StormDB
Amazon RDS
14©2014 TransLattice, Inc. All Rights Reserved.
MPP Performance – DBT-1 (TPC-H)
Postgres-XL
PostgreSQL
Postgres-XL
15©2014 TransLattice, Inc. All Rights Reserved.
Key-value Store Comparison
Postgres-XL
MongoDB
17©2014 TransLattice, Inc. All Rights Reserved.
Postgres-XL Architecture
•  Based on the Postgres-XC project
•  Coordinators
•  Connection point for applications
•  Parsing and planning of queries
•  Data Nodes
•  Actual data storage
•  Local execution of queries
•  Global Transaction Manager (GTM)
•  Provides a consistent view to transactions
•  GTM Proxy to increase performance
18©2014 TransLattice, Inc. All Rights Reserved.
Coordinators
•  Handles network connectivity to the client
•  Parse and plan statements
•  Perform final query processing of intermediate
result sets
•  Manages two-phase commit
•  Stores global catalog information
19©2014 TransLattice, Inc. All Rights Reserved.
Data Nodes
•  Stores tables and indexes
•  Only coordinators connects to data nodes
•  Executes queries from the coordinators
•  Communicates with peer data nodes for
distributed joins
20©2014 TransLattice, Inc. All Rights Reserved.
Global Transaction Manager (GTM)
•  Handles necessary MVCC tasks
•  Transaction IDs
•  Snapshots
•  Manages cluster wide values
•  Timestamps
•  Sequences
•  GTM Standby can be configured
21©2014 TransLattice, Inc. All Rights Reserved.
GTM Proxy
•  Runs alongside Coordinator or Datanode
•  Groups requests together
•  Obtain range of transaction ids (XIDs)
•  Obtain snapshot
22©2014 TransLattice, Inc. All Rights Reserved.
Data Distribution
•  Replicated Tables
•  Each row is replicated
to all data nodes
•  Statement based
replication
•  Distributed Tables
•  Each row is stored on
one data node
•  Available strategies
•  Hash
•  Round Robin
•  Modulo
23©2014 TransLattice, Inc. All Rights Reserved.
Availability
•  No Single Point of
Failure
•  Global Transaction
Manager Standby
•  Coordinators are load
balanced
•  Streaming replication for
data nodes
•  But, currently manual…
24©2014 TransLattice, Inc. All Rights Reserved.
DDL
25©2014 TransLattice, Inc. All Rights Reserved.
Defining Tables
CREATE TABLE my_table (…)
DISTRIBUTE BY
HASH(col) | MODULO(col) | ROUNDROBIN | REPLICATION
[ TO NODE (nodename[,nodename…])]
26©2014 TransLattice, Inc. All Rights Reserved.
Defining Tables
CREATE TABLE state_code (
state_code CHAR(2),
state_name VARCHAR,
:
) DISTRIBUTE BY REPLICATION
An exact replica on each node
27©2014 TransLattice, Inc. All Rights Reserved.
Defining Tables
CREATE TABLE invoice (
invoice_id SERIAL,
cust_id INT,
:
) DISTRIBUTE BY HASH(invoice_id)
Distributed evenly amongst sharded nodes
28©2014 TransLattice, Inc. All Rights Reserved.
Defining Tables
CREATE TABLE invoice (
invoice_id SERIAL,
cust_id INT ….
) DISTRIBUTE BY HASH(invoice_id);
CREATE TABLE lineitem (
lineitem_id SERIAL,
invoice_id INT …
) DISTRIBUTE BY HASH(invoice_id);
Joins on invoice_id can be pushed down to the datanodes
29©2014 TransLattice, Inc. All Rights Reserved.
test2=# create table t1 (col1 int,
col2 int) distribute by
hash(col1);
test2=# create table t2 (col3 int,
col4 int) distribute by
hash(col3);
30©2014 TransLattice, Inc. All Rights Reserved.
explain select * from t1 inner join t2 on
col1 = col3;
Remote Subquery Scan on all
(datanode_1,datanode_2)
-> Hash Join
Hash Cond:
-> Seq Scan on t1
-> Hash
-> Seq Scan on t2
Join push-down. Looks
much like regular
PostgreSQL
31©2014 TransLattice, Inc. All Rights Reserved.
test2=# explain select * from t1 inner join t2
on col2 = col3;
Remote Subquery Scan on all
(datanode_1,datanode_2)
-> Hash Join
Hash Cond:
-> Remote Subquery Scan on all
(datanode_1,datanode_2)
Distribute results by H: col2
-> Seq Scan on t1
-> Hash
-> Seq Scan on t2
Will read t1.col2 once and
put in shared queue for
consumption for other
datanodes for joining.
Datanode-datanode
communication and
parallelism
34©2014 TransLattice, Inc. All Rights Reserved.
35©2014 TransLattice, Inc. All Rights Reserved.
Configuration
36©2014 TransLattice, Inc. All Rights Reserved.
37©2014 TransLattice, Inc. All Rights Reserved.
Use pgxc_ctl!
(demo in a few minutes)
38©2014 TransLattice, Inc. All Rights Reserved.
Otherwise, PostgreSQL-like
steps apply:
initgtm
initdb
39©2014 TransLattice, Inc. All Rights Reserved.
postgresql.conf
•  Very similar to regular PostgreSQL
•  But there are extra parameters
•  max_pool_size
•  min_pool_size
•  pool_maintenance _timeout
•  remote_query_cost
•  network_byte_cost
•  sequence_range
•  pooler_port
•  gtm_host, gtm_port
•  shared_queues
•  shared_queue_size
40©2014 TransLattice, Inc. All Rights Reserved.
Install
n  Download RPMs
–  http://sourceforge.net/projects/postgres-xl/
files/Releases/Version_9.2rc/
Or
n  configure; make; make install
41©2014 TransLattice, Inc. All Rights Reserved.
Setup Environment
•  .bashrc
•  ssh used, so ad installation bin dir to
PATH
42©2014 TransLattice, Inc. All Rights Reserved.
Avoid password with pgxc_ctl
•  ssh-keygen –t rsa (in ~/.ssh)
•  For local test, no need to copy key,
already there
•  cat ~/.ssh/id_rsa.pub >> ~/.ssh/
authorized_keys
43©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl
•  Initialize cluster
•  Start/stop
•  Deploy to node
•  Add coordinator
•  Add data node / slave
•  Add GTM slave
44©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl.conf
•  Let’s create a local test cluster!
•  One GTM
•  One Coordinator
•  Two Datanodes
Make sure all are using different ports
•  including pooler_port
45©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl.conf
pgxcOwner=pgxl
pgxcUser=$pgxcOwner
pgxcInstallDir=/usr/postgres-xl-9.2
46©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl.conf
gtmMasterDir=/data/gtm_master
gtmMasterServer=localhost
gtmSlave=n
gtmProxy=n
47©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl.conf
coordMasterDir=/data/coord_master
coordNames=(coord1)
coordPorts=(5432)
poolerPorts=(20010)
coordMasterServers=(localhost)
coordMasterDirs=($coordMasterDir/coord1)
48©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl.conf
coordMaxWALSenders=($coordMaxWALsernder)
coordSlave=n
coordSpecificExtraConfig=(none)
coordSpecificExtraPgHba=(none)
49©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl.conf
datanodeNames=(dn1 dn2)
datanodeMasterDir=/data/dn_master
datanodePorts=(5433 5434)
datanodePoolerPorts=(20011 20012)
datanodeMasterServers=(localhost localhost)
datanodeMasterDirs=($datanodeMasterDir/dn1
$datanodeMasterDir/dn2)
50©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl.conf
datanodeMaxWALSenders=($datanodeMaxWalSe
nder $datanodeMaxWalSender)
datanodeSlave=n
primaryDatanode=dn1
51©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl
pgxc_ctl init all
Now have a working cluster
52©2014 TransLattice, Inc. All Rights Reserved.
pgxc_ctl – Add a second Coordinator
Format:
pgxc_ctl add coordinator master name host port
pooler data_dir
pgxc_ctl add coordinator master coord2 localhost
15432 20020 /data/coord_master/coord2
53©2014 TransLattice, Inc. All Rights Reserved.
PostgreSQL Differences
54©2014 TransLattice, Inc. All Rights Reserved.
pg_catalog
•  pgxc_node
•  Coordinator and Datanode definition
•  Currently not GTM
•  pgxc_class
•  Table replication or distribution info
55©2014 TransLattice, Inc. All Rights Reserved.
Additional Commands
•  PAUSE CLUSTER / UNPAUSE CLUSTER
•  Wait for current transactions to complete
•  Prevent new commands until UNPAUSE
•  EXECUTE DIRECT
ON (nodename) ‘command’
•  CLEAN CONNECTION
•  Cleans connection pool
•  CREATE NODE / ALTER NODE
56©2014 TransLattice, Inc. All Rights Reserved.
Noteworthy
•  SELECT pgxc_pool_reload()
•  pgxc_clean for 2PC
•  Cleans prepared transactions
•  If committed on one node, must be
committed on all
•  If aborted on one node, must be aborted
on all
•  If both committed and aborted output
error
57©2014 TransLattice, Inc. All Rights Reserved.
Backup and Recovery
58©2014 TransLattice, Inc. All Rights Reserved.
Backup
•  Like PostgreSQL
•  pg_dump, pg_dumpall from any Coordinator
•  Will pull all data from all nodes in one central
location
•  No notion yet of parallel pg_dump of individual
nodes on node-by-node basis, nor parallel
pg_restore
59©2014 TransLattice, Inc. All Rights Reserved.
Cold Backup
•  Stop Cluster
•  Backup individual data directories on nodes’
file system
•  Gzip, compress, rsync off, etc
•  Cold restore do the opposite
60©2014 TransLattice, Inc. All Rights Reserved.
Hot Backup
•  Similar to PostgreSQL
•  Base backup individual nodes
•  use streaming replication or WAL archiving
•  Backup GTM control file
•  Contains XID
•  Contains Sequence values
•  Periodically written to
•  On restart, it will skip ahead some values
What about PITR?
61©2014 TransLattice, Inc. All Rights Reserved.
Hot Backup - Barriers
•  CREATE BARRIER ‘barrier_name’
•  Waits for currently committing transactions to
finish
•  Writes a barrier in each node’s WAL for a
consistent restoration point
•  Currently done manually!
•  Could be configured as background process in the
future to periodically write
In recovery.conf, use recovery_target_barrier
62©2014 TransLattice, Inc. All Rights Reserved.
Similarities and differences
compared to
Postgres-XC
63©2014 TransLattice, Inc. All Rights Reserved.
Code Merging
PostgreSQL
Postgres-XC
Postgres-XL
Postgres-XC
Enhancements
Postgres-XL
Enhancements
Planner and Executor
are different
64©2014 TransLattice, Inc. All Rights Reserved.
Similarities with
Postgres-XC
65©2014 TransLattice, Inc. All Rights Reserved.
Some of the original
Postgres-XC developers
developed Postgres-XL
66©2014 TransLattice, Inc. All Rights Reserved.
Global Transaction Manager
67©2014 TransLattice, Inc. All Rights Reserved.
Pooler
68©2014 TransLattice, Inc. All Rights Reserved.
pg_catalog
69©2014 TransLattice, Inc. All Rights Reserved.
pgxc_*
pgxc_ctl, pgxc_node
70©2014 TransLattice, Inc. All Rights Reserved.
“pgxc” =
Postgres-XL Cluster
J
71©2014 TransLattice, Inc. All Rights Reserved.
Differences compared to
Postgres-XC
72©2014 TransLattice, Inc. All Rights Reserved.
n  Performance
n  Multi-tenant security
n  Statistics
73©2014 TransLattice, Inc. All Rights Reserved.
Performance
Data node ßà Data node Communication
–  Avoid Coordinator-centric processing
–  Can be many times faster for some queries
Pooler needs to be configured for each Data node,
not just coordinator
–  More connections needed at each node
74©2014 TransLattice, Inc. All Rights Reserved.
Performance
Re-parse avoidance
In XC, SQL strings are sent to other nodes from
Coordinator, where they are reparsed and replanned.
In XL, plan once on coordinator, serialize and send
over
75©2014 TransLattice, Inc. All Rights Reserved.
Performance
Sequences
Detect frequently accessed sequences, fetch range
of values, avoid fewer round trips to GTM
COPY
INSERT SELECT
76©2014 TransLattice, Inc. All Rights Reserved.
Multi-tenant Security
User can only get own info from global pg_catalog
pg_database, pg_user
Harder to hack if names of other database objects
are unknown
77©2014 TransLattice, Inc. All Rights Reserved.
Statistics
storm_stats
Basic DML stats by time range
pg_stat_statements may be sufficient
78©2014 TransLattice, Inc. All Rights Reserved.
Differences
Planner and Executor are different
79©2014 TransLattice, Inc. All Rights Reserved.
Differences
GUC
n  remote_query_cost
n  network_byte_cost
n  pool_maintenance_timeout
n  sequence_range
n  shared_queues
n  shared_queue_size
80©2014 TransLattice, Inc. All Rights Reserved.
Looking at Postgres-XL Code
n  XC
#ifdef PGXC
n  XL
#ifdef XCP
#ifndef XCP
81©2014 TransLattice, Inc. All Rights Reserved.
Community
82©2014 TransLattice, Inc. All Rights Reserved.
Website and Code
n  postgres-xl.org
n  sourceforge.net/projects/postgres-xl
n  Will add mirror for github.com
n  Docs
–  files.postgres-xl.org/documentation/index.html
84©2014 TransLattice, Inc. All Rights Reserved.
Philosophy
n  Stability and bug fixes over features
n  Performance-focused
n  Open and inclusive
–  Welcome input for roadmap, priorities and design
–  Welcome others to become core members and
contributors
85©2014 TransLattice, Inc. All Rights Reserved.
Planned Community Structure
n  Like PostgreSQL
–  Core
–  Major Contributors
–  Minor Contributors
–  Advocacy
87©2014 TransLattice, Inc. All Rights Reserved.
Roadmap
n  Catch up to PostgreSQL Community -> 9.3, 9.4
n  Make XL a more robust analytical platform
–  Distributed Foreign Data Wrappers
n  Remove blockers to adoption
n  Native High Availability
88©2014 TransLattice, Inc. All Rights Reserved.
Thank You!
msharp@translattice.com
@mason_db
1 of 81

Recommended

Evening out the uneven: dealing with skew in Flink by
Evening out the uneven: dealing with skew in FlinkEvening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in FlinkFlink Forward
2.5K views35 slides
Building a fully managed stream processing platform on Flink at scale for Lin... by
Building a fully managed stream processing platform on Flink at scale for Lin...Building a fully managed stream processing platform on Flink at scale for Lin...
Building a fully managed stream processing platform on Flink at scale for Lin...Flink Forward
855 views56 slides
Building a Data Pipeline using Apache Airflow (on AWS / GCP) by
Building a Data Pipeline using Apache Airflow (on AWS / GCP)Building a Data Pipeline using Apache Airflow (on AWS / GCP)
Building a Data Pipeline using Apache Airflow (on AWS / GCP)Yohei Onishi
5.6K views28 slides
Streaming SQL with Apache Calcite by
Streaming SQL with Apache CalciteStreaming SQL with Apache Calcite
Streaming SQL with Apache CalciteJulian Hyde
7.7K views34 slides
Change Data Feed in Delta by
Change Data Feed in DeltaChange Data Feed in Delta
Change Data Feed in DeltaDatabricks
1.6K views21 slides
Where is my bottleneck? Performance troubleshooting in Flink by
Where is my bottleneck? Performance troubleshooting in FlinkWhere is my bottleneck? Performance troubleshooting in Flink
Where is my bottleneck? Performance troubleshooting in FlinkFlink Forward
538 views32 slides

More Related Content

What's hot

Understanding PostgreSQL LW Locks by
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksJignesh Shah
12.8K views26 slides
Oracle GoldenGate Architecture Performance by
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceEnkitec
4.1K views35 slides
Dataguard presentation by
Dataguard presentationDataguard presentation
Dataguard presentationVimlendu Kumar
10K views19 slides
Introduction to Apache Flink - Fast and reliable big data processing by
Introduction to Apache Flink - Fast and reliable big data processingIntroduction to Apache Flink - Fast and reliable big data processing
Introduction to Apache Flink - Fast and reliable big data processingTill Rohrmann
7.2K views23 slides
Real-Time Spark: From Interactive Queries to Streaming by
Real-Time Spark: From Interactive Queries to StreamingReal-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to StreamingDatabricks
5.2K views39 slides
Oracle database performance tuning by
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuningYogiji Creations
14.6K views42 slides

What's hot(20)

Understanding PostgreSQL LW Locks by Jignesh Shah
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW Locks
Jignesh Shah12.8K views
Oracle GoldenGate Architecture Performance by Enkitec
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
Enkitec4.1K views
Introduction to Apache Flink - Fast and reliable big data processing by Till Rohrmann
Introduction to Apache Flink - Fast and reliable big data processingIntroduction to Apache Flink - Fast and reliable big data processing
Introduction to Apache Flink - Fast and reliable big data processing
Till Rohrmann7.2K views
Real-Time Spark: From Interactive Queries to Streaming by Databricks
Real-Time Spark: From Interactive Queries to StreamingReal-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to Streaming
Databricks5.2K views
Oracle database performance tuning by Yogiji Creations
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
Yogiji Creations14.6K views
A Thorough Comparison of Delta Lake, Iceberg and Hudi by Databricks
A Thorough Comparison of Delta Lake, Iceberg and HudiA Thorough Comparison of Delta Lake, Iceberg and Hudi
A Thorough Comparison of Delta Lake, Iceberg and Hudi
Databricks11.1K views
How Netflix Tunes EC2 Instances for Performance by Brendan Gregg
How Netflix Tunes EC2 Instances for PerformanceHow Netflix Tunes EC2 Instances for Performance
How Netflix Tunes EC2 Instances for Performance
Brendan Gregg524.4K views
Oracle Enterprise Manager Cloud Control 13c for DBAs by Gokhan Atil
Oracle Enterprise Manager Cloud Control 13c for DBAsOracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAs
Gokhan Atil33.1K views
Druid: Sub-Second OLAP queries over Petabytes of Streaming Data by DataWorks Summit
Druid: Sub-Second OLAP queries over Petabytes of Streaming DataDruid: Sub-Second OLAP queries over Petabytes of Streaming Data
Druid: Sub-Second OLAP queries over Petabytes of Streaming Data
DataWorks Summit3.4K views
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6 by David Pasek
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
David Pasek1.7K views
Why oracle data guard new features in oracle 18c, 19c by Satishbabu Gunukula
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19c
Satishbabu Gunukula1.7K views
Exactly-Once Financial Data Processing at Scale with Flink and Pinot by Flink Forward
Exactly-Once Financial Data Processing at Scale with Flink and PinotExactly-Once Financial Data Processing at Scale with Flink and Pinot
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
Flink Forward694 views
Extending Apache Ranger Authorization Beyond Hadoop: Review of Apache Ranger ... by DataWorks Summit
Extending Apache Ranger Authorization Beyond Hadoop: Review of Apache Ranger ...Extending Apache Ranger Authorization Beyond Hadoop: Review of Apache Ranger ...
Extending Apache Ranger Authorization Beyond Hadoop: Review of Apache Ranger ...
DataWorks Summit1.4K views
Oracle Latch and Mutex Contention Troubleshooting by Tanel Poder
Oracle Latch and Mutex Contention TroubleshootingOracle Latch and Mutex Contention Troubleshooting
Oracle Latch and Mutex Contention Troubleshooting
Tanel Poder7.2K views
Oracle statistics by example by Mauro Pagano
Oracle statistics by exampleOracle statistics by example
Oracle statistics by example
Mauro Pagano1.6K views
Oracle data guard for beginners by Pini Dibask
Oracle data guard for beginnersOracle data guard for beginners
Oracle data guard for beginners
Pini Dibask1.7K views

Viewers also liked

Bn 1016 demo postgre sql-online-training by
Bn 1016 demo  postgre sql-online-trainingBn 1016 demo  postgre sql-online-training
Bn 1016 demo postgre sql-online-trainingconline training
823 views22 slides
Making Postgres Central in Your Data Center by
Making Postgres Central in Your Data CenterMaking Postgres Central in Your Data Center
Making Postgres Central in Your Data CenterEDB
1.3K views44 slides
Why PostgreSQL for Analytics Infrastructure (DW)? by
Why PostgreSQL for Analytics Infrastructure (DW)?Why PostgreSQL for Analytics Infrastructure (DW)?
Why PostgreSQL for Analytics Infrastructure (DW)?Huy Nguyen
2.7K views50 slides
5 Postgres DBA Tips by
5 Postgres DBA Tips5 Postgres DBA Tips
5 Postgres DBA TipsEDB
1.4K views20 slides
One Coin One Brick project by
One Coin One Brick projectOne Coin One Brick project
One Coin One Brick projectHuy Nguyen
653 views8 slides
What's New in PostgreSQL 9.6 by
What's New in PostgreSQL 9.6What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6EDB
2.1K views20 slides

Viewers also liked(7)

Bn 1016 demo postgre sql-online-training by conline training
Bn 1016 demo  postgre sql-online-trainingBn 1016 demo  postgre sql-online-training
Bn 1016 demo postgre sql-online-training
conline training823 views
Making Postgres Central in Your Data Center by EDB
Making Postgres Central in Your Data CenterMaking Postgres Central in Your Data Center
Making Postgres Central in Your Data Center
EDB1.3K views
Why PostgreSQL for Analytics Infrastructure (DW)? by Huy Nguyen
Why PostgreSQL for Analytics Infrastructure (DW)?Why PostgreSQL for Analytics Infrastructure (DW)?
Why PostgreSQL for Analytics Infrastructure (DW)?
Huy Nguyen2.7K views
5 Postgres DBA Tips by EDB
5 Postgres DBA Tips5 Postgres DBA Tips
5 Postgres DBA Tips
EDB1.4K views
One Coin One Brick project by Huy Nguyen
One Coin One Brick projectOne Coin One Brick project
One Coin One Brick project
Huy Nguyen653 views
What's New in PostgreSQL 9.6 by EDB
What's New in PostgreSQL 9.6What's New in PostgreSQL 9.6
What's New in PostgreSQL 9.6
EDB2.1K views
PostgreSQL 9.6 Performance-Scalability Improvements by PGConf APAC
PostgreSQL 9.6 Performance-Scalability ImprovementsPostgreSQL 9.6 Performance-Scalability Improvements
PostgreSQL 9.6 Performance-Scalability Improvements
PGConf APAC2.6K views

Similar to Supersized PostgreSQL: Postgres-XL for Scale-Out OLTP and Big Data Analytics

Tajo_Meetup_20141120 by
Tajo_Meetup_20141120Tajo_Meetup_20141120
Tajo_Meetup_20141120Hyoungjun Kim
3K views31 slides
Tez Data Processing over Yarn by
Tez Data Processing over YarnTez Data Processing over Yarn
Tez Data Processing over YarnInMobi Technology
2.4K views29 slides
Apache Tez -- A modern processing engine by
Apache Tez -- A modern processing engineApache Tez -- A modern processing engine
Apache Tez -- A modern processing enginebigdatagurus_meetup
374 views45 slides
MapR-DB Elasticsearch Integration by
MapR-DB Elasticsearch IntegrationMapR-DB Elasticsearch Integration
MapR-DB Elasticsearch IntegrationMapR Technologies
3.2K views17 slides
Introduction to HPC & Supercomputing in AI by
Introduction to HPC & Supercomputing in AIIntroduction to HPC & Supercomputing in AI
Introduction to HPC & Supercomputing in AITyrone Systems
213 views35 slides
Apache Thrift, a brief introduction by
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introductionRandy Abernethy
3.7K views19 slides

Similar to Supersized PostgreSQL: Postgres-XL for Scale-Out OLTP and Big Data Analytics(20)

Introduction to HPC & Supercomputing in AI by Tyrone Systems
Introduction to HPC & Supercomputing in AIIntroduction to HPC & Supercomputing in AI
Introduction to HPC & Supercomputing in AI
Tyrone Systems213 views
Apache Thrift, a brief introduction by Randy Abernethy
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introduction
Randy Abernethy3.7K views
Tez: Accelerating Data Pipelines - fifthel by t3rmin4t0r
Tez: Accelerating Data Pipelines - fifthelTez: Accelerating Data Pipelines - fifthel
Tez: Accelerating Data Pipelines - fifthel
t3rmin4t0r1.5K views
Performance Optimizations in Apache Impala by Cloudera, Inc.
Performance Optimizations in Apache ImpalaPerformance Optimizations in Apache Impala
Performance Optimizations in Apache Impala
Cloudera, Inc.10.7K views
Drill into Drill – How Providing Flexibility and Performance is Possible by MapR Technologies
Drill into Drill – How Providing Flexibility and Performance is PossibleDrill into Drill – How Providing Flexibility and Performance is Possible
Drill into Drill – How Providing Flexibility and Performance is Possible
MapR Technologies1.9K views
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean) by Gruter
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)
Gruter_TECHDAY_2014_03_ApacheTajo (in Korean)
Gruter3.4K views
Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam... by HostedbyConfluent
Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...
Running Production CDC Ingestion Pipelines With Balaji Varadarajan and Pritam...
HostedbyConfluent433 views
Tez big datacamp-la-bikas_saha by Data Con LA
Tez big datacamp-la-bikas_sahaTez big datacamp-la-bikas_saha
Tez big datacamp-la-bikas_saha
Data Con LA652 views
OpenTSDB for monitoring @ Criteo by Nathaniel Braun
OpenTSDB for monitoring @ CriteoOpenTSDB for monitoring @ Criteo
OpenTSDB for monitoring @ Criteo
Nathaniel Braun1.2K views
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform by DataStax Academy
Large Scale Data Analytics with Spark and Cassandra on the DSE PlatformLarge Scale Data Analytics with Spark and Cassandra on the DSE Platform
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform
DataStax Academy1.7K views
SQL Engines for Hadoop - The case for Impala by markgrover
SQL Engines for Hadoop - The case for ImpalaSQL Engines for Hadoop - The case for Impala
SQL Engines for Hadoop - The case for Impala
markgrover1.2K views
Postgres Vienna DB Meetup 2014 by Michael Renner
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014
Michael Renner1.2K views
Presto – Today and Beyond – The Open Source SQL Engine for Querying all Data... by Dipti Borkar
Presto – Today and Beyond – The Open Source SQL Engine for Querying all Data...Presto – Today and Beyond – The Open Source SQL Engine for Querying all Data...
Presto – Today and Beyond – The Open Source SQL Engine for Querying all Data...
Dipti Borkar376 views
Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014 by NoSQLmatters
Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014
Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014
NoSQLmatters2.4K views

Recently uploaded

CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TShapeBlue
81 views34 slides
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...ShapeBlue
114 views12 slides
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...ShapeBlue
48 views17 slides
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
142 views32 slides
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...ShapeBlue
113 views18 slides
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericShapeBlue
58 views9 slides

Recently uploaded(20)

CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T by ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue81 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue114 views
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue48 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson142 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue113 views
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ by ShapeBlue
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
ShapeBlue58 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue154 views
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O... by ShapeBlue
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue59 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue97 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue138 views
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... by ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue121 views
State of the Union - Rohit Yadav - Apache CloudStack by ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue218 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10110 views
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by ShapeBlue
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool
ShapeBlue56 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue120 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu287 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue128 views

Supersized PostgreSQL: Postgres-XL for Scale-Out OLTP and Big Data Analytics

  • 1. 1©2014 TransLattice, Inc. All Rights Reserved. 1 Supersized PostgreSQL: Postgres-XL for Scale-out OLTP and Big Data Analytics June 17, 2014 Mason Sharp
  • 2. 2©2014 TransLattice, Inc. All Rights Reserved. Agenda •  Postgres-XL Background •  Architecture Overview •  Distributing Tables •  Configuring a Local Cluster •  Backup and Recovery •  Differences to PostgreSQL and Postgres-XC •  Community
  • 3. 3©2014 TransLattice, Inc. All Rights Reserved. Announced May 2014
  • 4. 4©2014 TransLattice, Inc. All Rights Reserved. Postgres-XL n  Open Source n  Scale-out RDBMS –  Massive Parallel Processing –  OLTP write and read scalability –  Multi-tenant security –  Cluster-wide ACID properties –  Can also act as distributed key-value store n  Mixed workloads, can eliminate need for separate clusters in some cases
  • 5. 5©2014 TransLattice, Inc. All Rights Reserved. XL Origins Considered open sourcing very early
  • 6. 6©2014 TransLattice, Inc. All Rights Reserved. Postgres-XL Applications and Use Case Examples Postgres-XL Application Use Case Example Business intelligence requiring MPP parallelism Financial services big data analysis of opportunities across service lines OLTP write-intensive workloads Online ad tracking Mixed workload environments Real-time reporting on a transactional system
  • 7. 8©2014 TransLattice, Inc. All Rights Reserved. Postgres-XL Technology •  Data is automatically spread across cluster •  Queries return back data from all nodes in parallel •  The Global Transaction Manager maintains a consistent view of the data across cluster •  Connect to any coordinator
  • 8. 9©2014 TransLattice, Inc. All Rights Reserved. Postgres-XL Features •  Multi Version Concurrency Control •  Referential Integrity* •  Full Text Search •  Geo-spatial Functions and Data Types •  JSON and XML Support •  Distributed Key-Value Store
  • 9. 10©2014 TransLattice, Inc. All Rights Reserved. Postgres-XL Missing Features •  Built in High Availability •  Use external like Corosync/Pacemaker •  Area for future improvement •  “Easy” to re-shard / add nodes •  Some pieces there •  Can however “pre-shard” multiple nodes on the same server or VM •  Some FK and UNIQUE constraints
  • 10. 11©2014 TransLattice, Inc. All Rights Reserved. Postgres-XL Connectors Looks like a PostgreSQL 9.2 database •  C •  C++ •  Perl •  Python •  PHP •  Erlang •  Haskell – Java – Javascript – .NET – Node.js – Ruby – Scala
  • 11. 13©2014 TransLattice, Inc. All Rights Reserved. Performance Transactional work loads 10 50 100 200 300 400 0 2000 4000 6000 8000 10000 12000 14000 16000 18000 Dell DVD Benchmark StormDB Amazon RDS
  • 12. 14©2014 TransLattice, Inc. All Rights Reserved. MPP Performance – DBT-1 (TPC-H) Postgres-XL PostgreSQL Postgres-XL
  • 13. 15©2014 TransLattice, Inc. All Rights Reserved. Key-value Store Comparison Postgres-XL MongoDB
  • 14. 17©2014 TransLattice, Inc. All Rights Reserved. Postgres-XL Architecture •  Based on the Postgres-XC project •  Coordinators •  Connection point for applications •  Parsing and planning of queries •  Data Nodes •  Actual data storage •  Local execution of queries •  Global Transaction Manager (GTM) •  Provides a consistent view to transactions •  GTM Proxy to increase performance
  • 15. 18©2014 TransLattice, Inc. All Rights Reserved. Coordinators •  Handles network connectivity to the client •  Parse and plan statements •  Perform final query processing of intermediate result sets •  Manages two-phase commit •  Stores global catalog information
  • 16. 19©2014 TransLattice, Inc. All Rights Reserved. Data Nodes •  Stores tables and indexes •  Only coordinators connects to data nodes •  Executes queries from the coordinators •  Communicates with peer data nodes for distributed joins
  • 17. 20©2014 TransLattice, Inc. All Rights Reserved. Global Transaction Manager (GTM) •  Handles necessary MVCC tasks •  Transaction IDs •  Snapshots •  Manages cluster wide values •  Timestamps •  Sequences •  GTM Standby can be configured
  • 18. 21©2014 TransLattice, Inc. All Rights Reserved. GTM Proxy •  Runs alongside Coordinator or Datanode •  Groups requests together •  Obtain range of transaction ids (XIDs) •  Obtain snapshot
  • 19. 22©2014 TransLattice, Inc. All Rights Reserved. Data Distribution •  Replicated Tables •  Each row is replicated to all data nodes •  Statement based replication •  Distributed Tables •  Each row is stored on one data node •  Available strategies •  Hash •  Round Robin •  Modulo
  • 20. 23©2014 TransLattice, Inc. All Rights Reserved. Availability •  No Single Point of Failure •  Global Transaction Manager Standby •  Coordinators are load balanced •  Streaming replication for data nodes •  But, currently manual…
  • 21. 24©2014 TransLattice, Inc. All Rights Reserved. DDL
  • 22. 25©2014 TransLattice, Inc. All Rights Reserved. Defining Tables CREATE TABLE my_table (…) DISTRIBUTE BY HASH(col) | MODULO(col) | ROUNDROBIN | REPLICATION [ TO NODE (nodename[,nodename…])]
  • 23. 26©2014 TransLattice, Inc. All Rights Reserved. Defining Tables CREATE TABLE state_code ( state_code CHAR(2), state_name VARCHAR, : ) DISTRIBUTE BY REPLICATION An exact replica on each node
  • 24. 27©2014 TransLattice, Inc. All Rights Reserved. Defining Tables CREATE TABLE invoice ( invoice_id SERIAL, cust_id INT, : ) DISTRIBUTE BY HASH(invoice_id) Distributed evenly amongst sharded nodes
  • 25. 28©2014 TransLattice, Inc. All Rights Reserved. Defining Tables CREATE TABLE invoice ( invoice_id SERIAL, cust_id INT …. ) DISTRIBUTE BY HASH(invoice_id); CREATE TABLE lineitem ( lineitem_id SERIAL, invoice_id INT … ) DISTRIBUTE BY HASH(invoice_id); Joins on invoice_id can be pushed down to the datanodes
  • 26. 29©2014 TransLattice, Inc. All Rights Reserved. test2=# create table t1 (col1 int, col2 int) distribute by hash(col1); test2=# create table t2 (col3 int, col4 int) distribute by hash(col3);
  • 27. 30©2014 TransLattice, Inc. All Rights Reserved. explain select * from t1 inner join t2 on col1 = col3; Remote Subquery Scan on all (datanode_1,datanode_2) -> Hash Join Hash Cond: -> Seq Scan on t1 -> Hash -> Seq Scan on t2 Join push-down. Looks much like regular PostgreSQL
  • 28. 31©2014 TransLattice, Inc. All Rights Reserved. test2=# explain select * from t1 inner join t2 on col2 = col3; Remote Subquery Scan on all (datanode_1,datanode_2) -> Hash Join Hash Cond: -> Remote Subquery Scan on all (datanode_1,datanode_2) Distribute results by H: col2 -> Seq Scan on t1 -> Hash -> Seq Scan on t2 Will read t1.col2 once and put in shared queue for consumption for other datanodes for joining. Datanode-datanode communication and parallelism
  • 29. 34©2014 TransLattice, Inc. All Rights Reserved.
  • 30. 35©2014 TransLattice, Inc. All Rights Reserved. Configuration
  • 31. 36©2014 TransLattice, Inc. All Rights Reserved.
  • 32. 37©2014 TransLattice, Inc. All Rights Reserved. Use pgxc_ctl! (demo in a few minutes)
  • 33. 38©2014 TransLattice, Inc. All Rights Reserved. Otherwise, PostgreSQL-like steps apply: initgtm initdb
  • 34. 39©2014 TransLattice, Inc. All Rights Reserved. postgresql.conf •  Very similar to regular PostgreSQL •  But there are extra parameters •  max_pool_size •  min_pool_size •  pool_maintenance _timeout •  remote_query_cost •  network_byte_cost •  sequence_range •  pooler_port •  gtm_host, gtm_port •  shared_queues •  shared_queue_size
  • 35. 40©2014 TransLattice, Inc. All Rights Reserved. Install n  Download RPMs –  http://sourceforge.net/projects/postgres-xl/ files/Releases/Version_9.2rc/ Or n  configure; make; make install
  • 36. 41©2014 TransLattice, Inc. All Rights Reserved. Setup Environment •  .bashrc •  ssh used, so ad installation bin dir to PATH
  • 37. 42©2014 TransLattice, Inc. All Rights Reserved. Avoid password with pgxc_ctl •  ssh-keygen –t rsa (in ~/.ssh) •  For local test, no need to copy key, already there •  cat ~/.ssh/id_rsa.pub >> ~/.ssh/ authorized_keys
  • 38. 43©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl •  Initialize cluster •  Start/stop •  Deploy to node •  Add coordinator •  Add data node / slave •  Add GTM slave
  • 39. 44©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl.conf •  Let’s create a local test cluster! •  One GTM •  One Coordinator •  Two Datanodes Make sure all are using different ports •  including pooler_port
  • 40. 45©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl.conf pgxcOwner=pgxl pgxcUser=$pgxcOwner pgxcInstallDir=/usr/postgres-xl-9.2
  • 41. 46©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl.conf gtmMasterDir=/data/gtm_master gtmMasterServer=localhost gtmSlave=n gtmProxy=n
  • 42. 47©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl.conf coordMasterDir=/data/coord_master coordNames=(coord1) coordPorts=(5432) poolerPorts=(20010) coordMasterServers=(localhost) coordMasterDirs=($coordMasterDir/coord1)
  • 43. 48©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl.conf coordMaxWALSenders=($coordMaxWALsernder) coordSlave=n coordSpecificExtraConfig=(none) coordSpecificExtraPgHba=(none)
  • 44. 49©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl.conf datanodeNames=(dn1 dn2) datanodeMasterDir=/data/dn_master datanodePorts=(5433 5434) datanodePoolerPorts=(20011 20012) datanodeMasterServers=(localhost localhost) datanodeMasterDirs=($datanodeMasterDir/dn1 $datanodeMasterDir/dn2)
  • 45. 50©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl.conf datanodeMaxWALSenders=($datanodeMaxWalSe nder $datanodeMaxWalSender) datanodeSlave=n primaryDatanode=dn1
  • 46. 51©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl pgxc_ctl init all Now have a working cluster
  • 47. 52©2014 TransLattice, Inc. All Rights Reserved. pgxc_ctl – Add a second Coordinator Format: pgxc_ctl add coordinator master name host port pooler data_dir pgxc_ctl add coordinator master coord2 localhost 15432 20020 /data/coord_master/coord2
  • 48. 53©2014 TransLattice, Inc. All Rights Reserved. PostgreSQL Differences
  • 49. 54©2014 TransLattice, Inc. All Rights Reserved. pg_catalog •  pgxc_node •  Coordinator and Datanode definition •  Currently not GTM •  pgxc_class •  Table replication or distribution info
  • 50. 55©2014 TransLattice, Inc. All Rights Reserved. Additional Commands •  PAUSE CLUSTER / UNPAUSE CLUSTER •  Wait for current transactions to complete •  Prevent new commands until UNPAUSE •  EXECUTE DIRECT ON (nodename) ‘command’ •  CLEAN CONNECTION •  Cleans connection pool •  CREATE NODE / ALTER NODE
  • 51. 56©2014 TransLattice, Inc. All Rights Reserved. Noteworthy •  SELECT pgxc_pool_reload() •  pgxc_clean for 2PC •  Cleans prepared transactions •  If committed on one node, must be committed on all •  If aborted on one node, must be aborted on all •  If both committed and aborted output error
  • 52. 57©2014 TransLattice, Inc. All Rights Reserved. Backup and Recovery
  • 53. 58©2014 TransLattice, Inc. All Rights Reserved. Backup •  Like PostgreSQL •  pg_dump, pg_dumpall from any Coordinator •  Will pull all data from all nodes in one central location •  No notion yet of parallel pg_dump of individual nodes on node-by-node basis, nor parallel pg_restore
  • 54. 59©2014 TransLattice, Inc. All Rights Reserved. Cold Backup •  Stop Cluster •  Backup individual data directories on nodes’ file system •  Gzip, compress, rsync off, etc •  Cold restore do the opposite
  • 55. 60©2014 TransLattice, Inc. All Rights Reserved. Hot Backup •  Similar to PostgreSQL •  Base backup individual nodes •  use streaming replication or WAL archiving •  Backup GTM control file •  Contains XID •  Contains Sequence values •  Periodically written to •  On restart, it will skip ahead some values What about PITR?
  • 56. 61©2014 TransLattice, Inc. All Rights Reserved. Hot Backup - Barriers •  CREATE BARRIER ‘barrier_name’ •  Waits for currently committing transactions to finish •  Writes a barrier in each node’s WAL for a consistent restoration point •  Currently done manually! •  Could be configured as background process in the future to periodically write In recovery.conf, use recovery_target_barrier
  • 57. 62©2014 TransLattice, Inc. All Rights Reserved. Similarities and differences compared to Postgres-XC
  • 58. 63©2014 TransLattice, Inc. All Rights Reserved. Code Merging PostgreSQL Postgres-XC Postgres-XL Postgres-XC Enhancements Postgres-XL Enhancements Planner and Executor are different
  • 59. 64©2014 TransLattice, Inc. All Rights Reserved. Similarities with Postgres-XC
  • 60. 65©2014 TransLattice, Inc. All Rights Reserved. Some of the original Postgres-XC developers developed Postgres-XL
  • 61. 66©2014 TransLattice, Inc. All Rights Reserved. Global Transaction Manager
  • 62. 67©2014 TransLattice, Inc. All Rights Reserved. Pooler
  • 63. 68©2014 TransLattice, Inc. All Rights Reserved. pg_catalog
  • 64. 69©2014 TransLattice, Inc. All Rights Reserved. pgxc_* pgxc_ctl, pgxc_node
  • 65. 70©2014 TransLattice, Inc. All Rights Reserved. “pgxc” = Postgres-XL Cluster J
  • 66. 71©2014 TransLattice, Inc. All Rights Reserved. Differences compared to Postgres-XC
  • 67. 72©2014 TransLattice, Inc. All Rights Reserved. n  Performance n  Multi-tenant security n  Statistics
  • 68. 73©2014 TransLattice, Inc. All Rights Reserved. Performance Data node ßà Data node Communication –  Avoid Coordinator-centric processing –  Can be many times faster for some queries Pooler needs to be configured for each Data node, not just coordinator –  More connections needed at each node
  • 69. 74©2014 TransLattice, Inc. All Rights Reserved. Performance Re-parse avoidance In XC, SQL strings are sent to other nodes from Coordinator, where they are reparsed and replanned. In XL, plan once on coordinator, serialize and send over
  • 70. 75©2014 TransLattice, Inc. All Rights Reserved. Performance Sequences Detect frequently accessed sequences, fetch range of values, avoid fewer round trips to GTM COPY INSERT SELECT
  • 71. 76©2014 TransLattice, Inc. All Rights Reserved. Multi-tenant Security User can only get own info from global pg_catalog pg_database, pg_user Harder to hack if names of other database objects are unknown
  • 72. 77©2014 TransLattice, Inc. All Rights Reserved. Statistics storm_stats Basic DML stats by time range pg_stat_statements may be sufficient
  • 73. 78©2014 TransLattice, Inc. All Rights Reserved. Differences Planner and Executor are different
  • 74. 79©2014 TransLattice, Inc. All Rights Reserved. Differences GUC n  remote_query_cost n  network_byte_cost n  pool_maintenance_timeout n  sequence_range n  shared_queues n  shared_queue_size
  • 75. 80©2014 TransLattice, Inc. All Rights Reserved. Looking at Postgres-XL Code n  XC #ifdef PGXC n  XL #ifdef XCP #ifndef XCP
  • 76. 81©2014 TransLattice, Inc. All Rights Reserved. Community
  • 77. 82©2014 TransLattice, Inc. All Rights Reserved. Website and Code n  postgres-xl.org n  sourceforge.net/projects/postgres-xl n  Will add mirror for github.com n  Docs –  files.postgres-xl.org/documentation/index.html
  • 78. 84©2014 TransLattice, Inc. All Rights Reserved. Philosophy n  Stability and bug fixes over features n  Performance-focused n  Open and inclusive –  Welcome input for roadmap, priorities and design –  Welcome others to become core members and contributors
  • 79. 85©2014 TransLattice, Inc. All Rights Reserved. Planned Community Structure n  Like PostgreSQL –  Core –  Major Contributors –  Minor Contributors –  Advocacy
  • 80. 87©2014 TransLattice, Inc. All Rights Reserved. Roadmap n  Catch up to PostgreSQL Community -> 9.3, 9.4 n  Make XL a more robust analytical platform –  Distributed Foreign Data Wrappers n  Remove blockers to adoption n  Native High Availability
  • 81. 88©2014 TransLattice, Inc. All Rights Reserved. Thank You! msharp@translattice.com @mason_db