SlideShare a Scribd company logo
1 of 26
Download to read offline
Implementing the Future
                    of PostgreSQL Clustering
                    with Tungsten



                    Robert Hodges
                    CTO, Continuent, Inc.



© Continuent 2009
                    PostgreSQL West - Seattle 2009
Agenda

  / Introductions
  / Framing the Problem: Clustering for the Masses
  / Introducing Tungsten
  / Adapting Tungsten to PostgreSQL
  / Questions and Comments




© Continuent 2009   PostgreSQL West - Seattle 2009
About Continuent

  / Our Business: Continuous Data Availability
  / Our Solution
           • Continuent Tungsten (Master/Slave Database Replication)
  / Our Value:
           • Ensure data are available when and where you need them
           • TCO less than 20% of comparable solutions
  / Our Technical Expertise
           • Database replication
           • Database cluster management
           • Application connectivity
  / Our Partner
           • 2ndQuadrant and Simon Riggs (thanks, Simon)




© Continuent 2009           PostgreSQL West - Seattle 2009
Framing the Problem:
                       Clustering for the Masses



© Continuent 2009   PostgreSQL West - Seattle 2009
Terminology



                      Cluster: A group of hosts
                     connected by a network that
                    work together to perform some
                             useful task




© Continuent 2009         PostgreSQL West - Seattle 2009
2005 - 2015: Rapid Technological Change

  / >95% of apps need only one DBMS host
           • Multi-core processors
           • Cheap main memory
           • Solid state devices (SSDs)
  / Shared infrastructure dominates operations
           • Virtualization/clouds for small DBMS
           • Shared database instances for ISP/SaaS
  / Massive growth in non-OLTP uses
           • Cheap, simple data stores
           • Read-intensive, web-facing applications
           • Webscale processing



© Continuent 2009        PostgreSQL West - Seattle 2009
2005 - 2015: Changing User Needs

  / Availability
  / Data Protection
  / Resource utilization
  / Performance
  / Open source/commercial integration
  / Geographically distributed data

© Continuent 2009   PostgreSQL West - Seattle 2009
2005-2015: What’s Cool and What’s Not

  / Tight coupling is OUT
           • Master/master (Postgres-R, Sequoia)
           • Shared disk (Oracle RAC)
  / Loose coupling is IN
           • Master/slave (MySQL)
           • Eventual consistency (SimpleDB, BigTable, Bucardo)
  / Simple management is IN
  / Efficient utilization is IN
           • Partitioning/multi-tenant models
           • Migration to more/less capable resources
           • Virtualized operation
  / Data protection is IN
© Continuent 2009        PostgreSQL West - Seattle 2009
Introducing Tungsten




© Continuent 2009
                    PostgreSQL West - Seattle 2009
What Is Tungsten?

  / Tungsten implements master/slave clusters to:
           •   Protect data
           •   Maintain high availability
           •   Improve resource utilization
           •   Raise performance
  / Install and set up in a few minutes
  / Integrated backup/restore and data integrity checks
  / Efficient failover operations
  / Distributed, rule-driven management
  / No/minimal application changes
  / Highly pluggable
  / No specialized hardware requirements

© Continuent 2009              PostgreSQL West - Seattle 2009
Tungsten Clustering In Action
             Application Server                  Application Server
              SQL Router/Connector               SQL Router/Connector
                    Manager                                 Manager




                          Replicator             Replicator
                              Monitor             Monitor
                           Manager               Manager

         Master DB                                                    Slave DB
                        Management              Management
    Master Host           Client                  Client               Slave Host

© Continuent 2009             PostgreSQL West - Seattle 2009
Distributed Rule-Based Management
    Business           Admin Client
     Rules                                                      Manager
                                 Group
                              Communications

          Manager                                            Local Services
       (Coordinator)
                                Broadcast commands
                                 and monitoring data               Admin Client
      Local Services


                                                             Manager
                                      Admin Client



                                                        Local Services
© Continuent 2009           PostgreSQL West - Seattle 2009
Open Replicator To Manage Non-Tungsten
  Replication
                               Tungsten Manager


                    Replicator JMX Interface                  Monitor
                    Replication State Model
                           Backup/             Backup          DBMS
          Replication                                         Checker
                           Restore             Storage
            Plug-In                                            Plugin
                           Plug-In              Plugin




       Non-Tungsten
        Replication
        Mechanism               DBMS


© Continuent 2009            PostgreSQL West - Seattle 2009
SQL Routing

                    Java App Server               PHP Application
                    Tungsten SQL Router           libmysqlclient.a
              MySQL JDBC Driver

                                                  Tungsten Connector   Admin &
       Admin &                                                         Monitoring
       Monitoring                                Tungsten SQL Router
                                               MySQL JDBC Driver



                              Tungsten Cluster

© Continuent 2009               PostgreSQL West - Seattle 2009
What Does This Get Us?

  / 15 minute installation
  / Single commands to:
           •   View cluster status
           •   Backup a server
           •   Restore a server
           •   Verify data across copies
           •   Confirm liveness of replication
           •   Switch servers safely for maintenance
           •   Failover a dead server to most current replica
  / Automatic discovery of new database replicas
  / Automatic failover when databases fail
  / Simple procedures for provisioning



© Continuent 2009              PostgreSQL West - Seattle 2009
Adapting Tungsten to
                       PostgreSQL



© Continuent 2009
                    PostgreSQL West - Seattle 2009
Moving Tungsten to PostgreSQL

  / Problem: We can’t read PostgreSQL logs (yet)
  / Solution: Manage Warm Standby/PITR to replicate
    data to standby DBMS
           • Good basic availability/fast failover
           • Once hot standby works this looks pretty good!
           • Does not cover maintenance especially well
  / Solution: Manage Londiste to replicate to active
    replicas
           • Covers maintenance and read scaling




© Continuent 2009           PostgreSQL West - Seattle 2009
Warm Standby Implementation
                    Master                                      Standby


              PostgreSQL                                     PostgreSQL




                             rsync to standby
                                                  Archived
                    WAL                                            WAL
                                                    WAL
                    Files                                          Files
                                                    Files

                pg_xlogs                         Archive         pg_xlogs
                Directory                        Directory       Directory


                                                    Copy from archive

© Continuent 2009              PostgreSQL West - Seattle 2009
Setting Up Warm Standby (Old Way)

  / Configure master postgresql.conf and reboot
           archive_mode = on
           archive_command =‘rsync -cz $1 ${STANDBY}:${PGHOME}/archive/$2
             %p %f'
           archive_timeout = 60

  / Set up standby recovery.conf
           restore_command =‘pg_standby -c -d -k 96 -r 1 -s 30 -w 0 -t
             ${PGDATA}/trigger.dat ${PGHOME}/archive %f %p %r’

  / Provision standby
           psql# select pg_switch_xlog();
           psql# select pg_xlogfile_name(pg_start_backup('base_backup'));
           rsync -cva --inplace --exclude=*pg_xlog* ${PGHOME}/
             $STANDBY:$PGHOME/archive
           psql# select pg_xlogfile_name(pg_stop_backup());

  / Start standby, recovery starts
  / Touch ${PGDATA}/trigger.dat to fail over

© Continuent 2009          PostgreSQL West - Seattle 2009
Warm Standby Caveats

  / Warm standby helps with availability, not scaling
  / Warm standby can lose data on unplanned failover!
  / Master recovery requires re-provisioning
  / Set-up/management is harder than it looks
  / Monitoring is critical
  / Cannot open standby before failover
  / Need to ensure all logs are read before failover


  Despite all the caveats it’s a great feature!!



© Continuent 2009   PostgreSQL West - Seattle 2009
Tungsten Warm Standby Implementation

                               Tungsten Manager


                    Replicator JMX Interface                  Monitor
                     Replication State Model
           Open Script     pg_dump/          Backup            DBMS
             Plugin
                          pg_restore           Storage        Checker
       Pg-wal Scripts       Plug-In             Plugin         Plugin




    postgresql.conf
     recovery.conf
       pg_standby               DBMS
             rsync

© Continuent 2009            PostgreSQL West - Seattle 2009
What Does This Get Us?

  / Easy setup of warm standby
  / Single commands to:
           •   View cluster status, including replication stats
           •   Backup a server
           •   Restore a server
           •   Provision a server
           •   Verify data across copies
           •   Confirm liveness of replication
           •   Switch servers safely for maintenance
           •   Failover a dead server to most current replica
  / Automatic discovery of databases
  / Automatic failover




© Continuent 2009               PostgreSQL West - Seattle 2009
Where Do We Go Next?

  / Fill in warm standby management features
           •   Detailed WAL setup features
           •   Slave backup
           •   Monitoring
           •   Notifications on failures/thresholds
           •   Ease of recovery
           •   Hot Standby/Log Streaming
  / Implement Londiste support for live replicas
  / Read PostgreSQL logs directly


  Plus a host of other useful features like floating IP
    support



© Continuent 2009               PostgreSQL West - Seattle 2009
Summary and Questions




© Continuent 2009   PostgreSQL West - Seattle 2009
Summary
  / Changing technology and user needs are
    reshaping clustering
  / Continuent Tungsten clusters solve new
    needs more effectively than other clustering
    approaches
  / Check out what we are doing and provide
    feedback




© Continuent 2009   PostgreSQL West - Seattle 2009
Contact Information


   HQ and Americas                        EMEA and APAC
   560 S. Winchester Blvd., Suite 500     Lars Sonckin kaari 16
   San Jose, CA 95128                     02600 Espoo, Finland
   Tel (866) 998-3642                     Tel +358 50 517 9059
   Fax (408) 668-1009                     Fax +358 9 863 0060

   e-mail: robert dot hodges at continuent dot com

                         Continuent Web Site:
                      http://www.continuent.com

                        2ndQuadrant Web Site:
                     http://www.2ndquadrant.com

© Continuent 2009         PostgreSQL West - Seattle 2009

More Related Content

What's hot

Scalability
ScalabilityScalability
Scalability
felho
 
Ultimate SharePoint Infrastructure Best Practices Session - Live360 Orlando 2012
Ultimate SharePoint Infrastructure Best Practices Session - Live360 Orlando 2012Ultimate SharePoint Infrastructure Best Practices Session - Live360 Orlando 2012
Ultimate SharePoint Infrastructure Best Practices Session - Live360 Orlando 2012
Michael Noel
 
BP103 - Got Problems? Let's Do a Health Check
BP103 - Got Problems? Let's Do a Health CheckBP103 - Got Problems? Let's Do a Health Check
BP103 - Got Problems? Let's Do a Health Check
Luis Guirigay
 
Codero Custom Configurations
Codero Custom ConfigurationsCodero Custom Configurations
Codero Custom Configurations
Codero
 

What's hot (20)

An Hour of DB2 Tips
An Hour of DB2 TipsAn Hour of DB2 Tips
An Hour of DB2 Tips
 
MySQL high availability power and usability
MySQL high availability power and usabilityMySQL high availability power and usability
MySQL high availability power and usability
 
BUG - BEA Users\' Group, Jan16 2003
BUG - BEA Users\' Group, Jan16 2003BUG - BEA Users\' Group, Jan16 2003
BUG - BEA Users\' Group, Jan16 2003
 
My sql 5.6_replwebinar_may12
My sql 5.6_replwebinar_may12My sql 5.6_replwebinar_may12
My sql 5.6_replwebinar_may12
 
Speed up your XPages Application performance
Speed up your XPages Application performanceSpeed up your XPages Application performance
Speed up your XPages Application performance
 
Tungsten University: Setup and Operate Tungsten Replicators
Tungsten University: Setup and Operate Tungsten ReplicatorsTungsten University: Setup and Operate Tungsten Replicators
Tungsten University: Setup and Operate Tungsten Replicators
 
The unified data center for cloud david yen
The unified data center for cloud david yenThe unified data center for cloud david yen
The unified data center for cloud david yen
 
Scalability
ScalabilityScalability
Scalability
 
Sql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampaSql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampa
 
VMworld 2013: Extreme Performance Series: Monster Virtual Machines
VMworld 2013: Extreme Performance Series: Monster Virtual Machines VMworld 2013: Extreme Performance Series: Monster Virtual Machines
VMworld 2013: Extreme Performance Series: Monster Virtual Machines
 
Ultimate SharePoint Infrastructure Best Practices Session - Live360 Orlando 2012
Ultimate SharePoint Infrastructure Best Practices Session - Live360 Orlando 2012Ultimate SharePoint Infrastructure Best Practices Session - Live360 Orlando 2012
Ultimate SharePoint Infrastructure Best Practices Session - Live360 Orlando 2012
 
Infrastruttura Scalabile Per Applicazioni Aziendali Oracle - Virtualise wit...
Infrastruttura Scalabile Per Applicazioni Aziendali   Oracle - Virtualise wit...Infrastruttura Scalabile Per Applicazioni Aziendali   Oracle - Virtualise wit...
Infrastruttura Scalabile Per Applicazioni Aziendali Oracle - Virtualise wit...
 
The Five R's: There Can be no DB2 Performance Improvement Without Them!
The Five R's: There Can be no DB2 Performance Improvement Without Them!The Five R's: There Can be no DB2 Performance Improvement Without Them!
The Five R's: There Can be no DB2 Performance Improvement Without Them!
 
Engineered Systems: Oracle's Vision for the Future
Engineered Systems: Oracle's Vision for the FutureEngineered Systems: Oracle's Vision for the Future
Engineered Systems: Oracle's Vision for the Future
 
Sql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday RichmondSql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday Richmond
 
BP103 - Got Problems? Let's Do a Health Check
BP103 - Got Problems? Let's Do a Health CheckBP103 - Got Problems? Let's Do a Health Check
BP103 - Got Problems? Let's Do a Health Check
 
VMware & Riverbed
VMware & RiverbedVMware & Riverbed
VMware & Riverbed
 
VMworld 2013: Big Data: Virtualized SAP HANA Performance, Scalability and Bes...
VMworld 2013: Big Data: Virtualized SAP HANA Performance, Scalability and Bes...VMworld 2013: Big Data: Virtualized SAP HANA Performance, Scalability and Bes...
VMworld 2013: Big Data: Virtualized SAP HANA Performance, Scalability and Bes...
 
ApacheCon EU 2009 Tales from the front line - ActiveMQ ServiceMix and CXF
ApacheCon EU 2009 Tales from the front line - ActiveMQ ServiceMix and CXFApacheCon EU 2009 Tales from the front line - ActiveMQ ServiceMix and CXF
ApacheCon EU 2009 Tales from the front line - ActiveMQ ServiceMix and CXF
 
Codero Custom Configurations
Codero Custom ConfigurationsCodero Custom Configurations
Codero Custom Configurations
 

Viewers also liked

pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
Command Prompt., Inc
 
Londiste Replication system for PostgreSQL
Londiste Replication system for PostgreSQLLondiste Replication system for PostgreSQL
Londiste Replication system for PostgreSQL
elliando dias
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with Skytools
Gavin Roy
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
Command Prompt., Inc
 
Replication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorReplication using PostgreSQL Replicator
Replication using PostgreSQL Replicator
Command Prompt., Inc
 

Viewers also liked (20)

Not Just UNIQUE: Generalized Index Constraints
Not Just UNIQUE: Generalized Index ConstraintsNot Just UNIQUE: Generalized Index Constraints
Not Just UNIQUE: Generalized Index Constraints
 
Bucardo
BucardoBucardo
Bucardo
 
PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...
PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...
PostgreSQL, Extensible to the Nth Degree: Functions, Languages, Types, Rules,...
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
Basic Query Tuning Primer
Basic Query Tuning PrimerBasic Query Tuning Primer
Basic Query Tuning Primer
 
The PostgreSQL Query Planner
The PostgreSQL Query PlannerThe PostgreSQL Query Planner
The PostgreSQL Query Planner
 
2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ru2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ru
 
Londiste Replication system for PostgreSQL
Londiste Replication system for PostgreSQLLondiste Replication system for PostgreSQL
Londiste Replication system for PostgreSQL
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with Skytools
 
Monitoreo tunning postgresql_2011
Monitoreo tunning postgresql_2011Monitoreo tunning postgresql_2011
Monitoreo tunning postgresql_2011
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
PostgreSQL: Un motor Impulsado por una comunidad
PostgreSQL: Un motor Impulsado por una comunidadPostgreSQL: Un motor Impulsado por una comunidad
PostgreSQL: Un motor Impulsado por una comunidad
 
PostgreSQL High Availability via SLONY and PG POOL II
PostgreSQL High Availability via SLONY and PG POOL IIPostgreSQL High Availability via SLONY and PG POOL II
PostgreSQL High Availability via SLONY and PG POOL II
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
 
Replication using PostgreSQL Replicator
Replication using PostgreSQL ReplicatorReplication using PostgreSQL Replicator
Replication using PostgreSQL Replicator
 
Pg migrator
Pg migratorPg migrator
Pg migrator
 
Backup and-recovery2
Backup and-recovery2Backup and-recovery2
Backup and-recovery2
 
configuring a warm standby, the easy way
configuring a warm standby, the easy wayconfiguring a warm standby, the easy way
configuring a warm standby, the easy way
 
Go replicator
Go replicatorGo replicator
Go replicator
 
Python utilities for data presentation
Python utilities for data presentationPython utilities for data presentation
Python utilities for data presentation
 

Similar to Implementing the Future of PostgreSQL Clustering with Tungsten

Database Performance With Proxy Architectures
Database  Performance With  Proxy  ArchitecturesDatabase  Performance With  Proxy  Architectures
Database Performance With Proxy Architectures
PerconaPerformance
 
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
LarryZaman
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
Continuent
 
D17316 gc20 l03_broker_em
D17316 gc20 l03_broker_emD17316 gc20 l03_broker_em
D17316 gc20 l03_broker_em
Moeen_uddin
 

Similar to Implementing the Future of PostgreSQL Clustering with Tungsten (20)

Living the Easy Life with Rules-Based Autonomic Database Clusters
Living the Easy Life with Rules-Based Autonomic Database ClustersLiving the Easy Life with Rules-Based Autonomic Database Clusters
Living the Easy Life with Rules-Based Autonomic Database Clusters
 
Database Performance With Proxy Architectures
Database  Performance With  Proxy  ArchitecturesDatabase  Performance With  Proxy  Architectures
Database Performance With Proxy Architectures
 
Building Tungsten Clusters with PostgreSQL Hot Standby and Streaming Replication
Building Tungsten Clusters with PostgreSQL Hot Standby and Streaming ReplicationBuilding Tungsten Clusters with PostgreSQL Hot Standby and Streaming Replication
Building Tungsten Clusters with PostgreSQL Hot Standby and Streaming Replication
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
Marketing Automation at Scale: How Marketo Solved Key Data Management Challen...
 
Continuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data ManagementContinuent Tungsten - Scalable Saa S Data Management
Continuent Tungsten - Scalable Saa S Data Management
 
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
 
Built-in Replication in PostgreSQL
Built-in Replication in PostgreSQLBuilt-in Replication in PostgreSQL
Built-in Replication in PostgreSQL
 
SQL Server Workshop Paul Bertucci
SQL Server Workshop Paul BertucciSQL Server Workshop Paul Bertucci
SQL Server Workshop Paul Bertucci
 
SQL Server 2008 Migration Workshop 04/29/2009
SQL Server 2008 Migration Workshop 04/29/2009SQL Server 2008 Migration Workshop 04/29/2009
SQL Server 2008 Migration Workshop 04/29/2009
 
Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!
Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!
Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!
 
Tungsten University: Set Up And Manage Advanced Replication Topologies
Tungsten University: Set Up And Manage Advanced Replication TopologiesTungsten University: Set Up And Manage Advanced Replication Topologies
Tungsten University: Set Up And Manage Advanced Replication Topologies
 
SQL Server User Group 02/2009
SQL Server User Group 02/2009SQL Server User Group 02/2009
SQL Server User Group 02/2009
 
D17316 gc20 l03_broker_em
D17316 gc20 l03_broker_emD17316 gc20 l03_broker_em
D17316 gc20 l03_broker_em
 
Tungsten University: Geographically Distributed Multi-Master MySQL Clusters
Tungsten University: Geographically Distributed Multi-Master MySQL ClustersTungsten University: Geographically Distributed Multi-Master MySQL Clusters
Tungsten University: Geographically Distributed Multi-Master MySQL Clusters
 
Using Snap Clone with Enterprise Manager 12c
Using Snap Clone with Enterprise Manager 12cUsing Snap Clone with Enterprise Manager 12c
Using Snap Clone with Enterprise Manager 12c
 
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware companyMySQL High Availability and Disaster Recovery with Continuent, a VMware company
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
 
Advanced MySQL Replication Architectures - Luis Soares
Advanced MySQL Replication Architectures - Luis SoaresAdvanced MySQL Replication Architectures - Luis Soares
Advanced MySQL Replication Architectures - Luis Soares
 
Our Multi-Year Journey to a 10x Faster Confluent Cloud
Our Multi-Year Journey to a 10x Faster Confluent CloudOur Multi-Year Journey to a 10x Faster Confluent Cloud
Our Multi-Year Journey to a 10x Faster Confluent Cloud
 

More from Command Prompt., Inc

More from Command Prompt., Inc (16)

Howdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable
Howdah - An Application using Pylons, PostgreSQL, Simpycity and ExceptableHowdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable
Howdah - An Application using Pylons, PostgreSQL, Simpycity and Exceptable
 
Temporal Data
Temporal DataTemporal Data
Temporal Data
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forks
 
A Practical Multi-Tenant Cluster
A Practical Multi-Tenant ClusterA Practical Multi-Tenant Cluster
A Practical Multi-Tenant Cluster
 
5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance
 
Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2Normalization: A Workshop for Everybody Pt. 2
Normalization: A Workshop for Everybody Pt. 2
 
Normalization: A Workshop for Everybody Pt. 1
Normalization: A Workshop for Everybody Pt. 1Normalization: A Workshop for Everybody Pt. 1
Normalization: A Workshop for Everybody Pt. 1
 
Integrating PostGIS in Web Applications
Integrating PostGIS in Web ApplicationsIntegrating PostGIS in Web Applications
Integrating PostGIS in Web Applications
 
Postgres for MySQL (and other database) people
Postgres for MySQL (and other database) peoplePostgres for MySQL (and other database) people
Postgres for MySQL (and other database) people
 
Building Grails applications with PostgreSQL
Building Grails applications with PostgreSQLBuilding Grails applications with PostgreSQL
Building Grails applications with PostgreSQL
 
Pg amqp
Pg amqpPg amqp
Pg amqp
 
Not Just UNIQUE: Exclusion Constraints
Not Just UNIQUE: Exclusion ConstraintsNot Just UNIQUE: Exclusion Constraints
Not Just UNIQUE: Exclusion Constraints
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
Database Hardware Benchmarking
Database Hardware BenchmarkingDatabase Hardware Benchmarking
Database Hardware Benchmarking
 
Vertically Challenged
Vertically ChallengedVertically Challenged
Vertically Challenged
 
Simpycity and Exceptable
Simpycity and ExceptableSimpycity and Exceptable
Simpycity and Exceptable
 

Implementing the Future of PostgreSQL Clustering with Tungsten

  • 1. Implementing the Future of PostgreSQL Clustering with Tungsten Robert Hodges CTO, Continuent, Inc. © Continuent 2009 PostgreSQL West - Seattle 2009
  • 2. Agenda / Introductions / Framing the Problem: Clustering for the Masses / Introducing Tungsten / Adapting Tungsten to PostgreSQL / Questions and Comments © Continuent 2009 PostgreSQL West - Seattle 2009
  • 3. About Continuent / Our Business: Continuous Data Availability / Our Solution • Continuent Tungsten (Master/Slave Database Replication) / Our Value: • Ensure data are available when and where you need them • TCO less than 20% of comparable solutions / Our Technical Expertise • Database replication • Database cluster management • Application connectivity / Our Partner • 2ndQuadrant and Simon Riggs (thanks, Simon) © Continuent 2009 PostgreSQL West - Seattle 2009
  • 4. Framing the Problem: Clustering for the Masses © Continuent 2009 PostgreSQL West - Seattle 2009
  • 5. Terminology Cluster: A group of hosts connected by a network that work together to perform some useful task © Continuent 2009 PostgreSQL West - Seattle 2009
  • 6. 2005 - 2015: Rapid Technological Change / >95% of apps need only one DBMS host • Multi-core processors • Cheap main memory • Solid state devices (SSDs) / Shared infrastructure dominates operations • Virtualization/clouds for small DBMS • Shared database instances for ISP/SaaS / Massive growth in non-OLTP uses • Cheap, simple data stores • Read-intensive, web-facing applications • Webscale processing © Continuent 2009 PostgreSQL West - Seattle 2009
  • 7. 2005 - 2015: Changing User Needs / Availability / Data Protection / Resource utilization / Performance / Open source/commercial integration / Geographically distributed data © Continuent 2009 PostgreSQL West - Seattle 2009
  • 8. 2005-2015: What’s Cool and What’s Not / Tight coupling is OUT • Master/master (Postgres-R, Sequoia) • Shared disk (Oracle RAC) / Loose coupling is IN • Master/slave (MySQL) • Eventual consistency (SimpleDB, BigTable, Bucardo) / Simple management is IN / Efficient utilization is IN • Partitioning/multi-tenant models • Migration to more/less capable resources • Virtualized operation / Data protection is IN © Continuent 2009 PostgreSQL West - Seattle 2009
  • 9. Introducing Tungsten © Continuent 2009 PostgreSQL West - Seattle 2009
  • 10. What Is Tungsten? / Tungsten implements master/slave clusters to: • Protect data • Maintain high availability • Improve resource utilization • Raise performance / Install and set up in a few minutes / Integrated backup/restore and data integrity checks / Efficient failover operations / Distributed, rule-driven management / No/minimal application changes / Highly pluggable / No specialized hardware requirements © Continuent 2009 PostgreSQL West - Seattle 2009
  • 11. Tungsten Clustering In Action Application Server Application Server SQL Router/Connector SQL Router/Connector Manager Manager Replicator Replicator Monitor Monitor Manager Manager Master DB Slave DB Management Management Master Host Client Client Slave Host © Continuent 2009 PostgreSQL West - Seattle 2009
  • 12. Distributed Rule-Based Management Business Admin Client Rules Manager Group Communications Manager Local Services (Coordinator) Broadcast commands and monitoring data Admin Client Local Services Manager Admin Client Local Services © Continuent 2009 PostgreSQL West - Seattle 2009
  • 13. Open Replicator To Manage Non-Tungsten Replication Tungsten Manager Replicator JMX Interface Monitor Replication State Model Backup/ Backup DBMS Replication Checker Restore Storage Plug-In Plugin Plug-In Plugin Non-Tungsten Replication Mechanism DBMS © Continuent 2009 PostgreSQL West - Seattle 2009
  • 14. SQL Routing Java App Server PHP Application Tungsten SQL Router libmysqlclient.a MySQL JDBC Driver Tungsten Connector Admin & Admin & Monitoring Monitoring Tungsten SQL Router MySQL JDBC Driver Tungsten Cluster © Continuent 2009 PostgreSQL West - Seattle 2009
  • 15. What Does This Get Us? / 15 minute installation / Single commands to: • View cluster status • Backup a server • Restore a server • Verify data across copies • Confirm liveness of replication • Switch servers safely for maintenance • Failover a dead server to most current replica / Automatic discovery of new database replicas / Automatic failover when databases fail / Simple procedures for provisioning © Continuent 2009 PostgreSQL West - Seattle 2009
  • 16. Adapting Tungsten to PostgreSQL © Continuent 2009 PostgreSQL West - Seattle 2009
  • 17. Moving Tungsten to PostgreSQL / Problem: We can’t read PostgreSQL logs (yet) / Solution: Manage Warm Standby/PITR to replicate data to standby DBMS • Good basic availability/fast failover • Once hot standby works this looks pretty good! • Does not cover maintenance especially well / Solution: Manage Londiste to replicate to active replicas • Covers maintenance and read scaling © Continuent 2009 PostgreSQL West - Seattle 2009
  • 18. Warm Standby Implementation Master Standby PostgreSQL PostgreSQL rsync to standby Archived WAL WAL WAL Files Files Files pg_xlogs Archive pg_xlogs Directory Directory Directory Copy from archive © Continuent 2009 PostgreSQL West - Seattle 2009
  • 19. Setting Up Warm Standby (Old Way) / Configure master postgresql.conf and reboot archive_mode = on archive_command =‘rsync -cz $1 ${STANDBY}:${PGHOME}/archive/$2 %p %f' archive_timeout = 60 / Set up standby recovery.conf restore_command =‘pg_standby -c -d -k 96 -r 1 -s 30 -w 0 -t ${PGDATA}/trigger.dat ${PGHOME}/archive %f %p %r’ / Provision standby psql# select pg_switch_xlog(); psql# select pg_xlogfile_name(pg_start_backup('base_backup')); rsync -cva --inplace --exclude=*pg_xlog* ${PGHOME}/ $STANDBY:$PGHOME/archive psql# select pg_xlogfile_name(pg_stop_backup()); / Start standby, recovery starts / Touch ${PGDATA}/trigger.dat to fail over © Continuent 2009 PostgreSQL West - Seattle 2009
  • 20. Warm Standby Caveats / Warm standby helps with availability, not scaling / Warm standby can lose data on unplanned failover! / Master recovery requires re-provisioning / Set-up/management is harder than it looks / Monitoring is critical / Cannot open standby before failover / Need to ensure all logs are read before failover Despite all the caveats it’s a great feature!! © Continuent 2009 PostgreSQL West - Seattle 2009
  • 21. Tungsten Warm Standby Implementation Tungsten Manager Replicator JMX Interface Monitor Replication State Model Open Script pg_dump/ Backup DBMS Plugin pg_restore Storage Checker Pg-wal Scripts Plug-In Plugin Plugin postgresql.conf recovery.conf pg_standby DBMS rsync © Continuent 2009 PostgreSQL West - Seattle 2009
  • 22. What Does This Get Us? / Easy setup of warm standby / Single commands to: • View cluster status, including replication stats • Backup a server • Restore a server • Provision a server • Verify data across copies • Confirm liveness of replication • Switch servers safely for maintenance • Failover a dead server to most current replica / Automatic discovery of databases / Automatic failover © Continuent 2009 PostgreSQL West - Seattle 2009
  • 23. Where Do We Go Next? / Fill in warm standby management features • Detailed WAL setup features • Slave backup • Monitoring • Notifications on failures/thresholds • Ease of recovery • Hot Standby/Log Streaming / Implement Londiste support for live replicas / Read PostgreSQL logs directly Plus a host of other useful features like floating IP support © Continuent 2009 PostgreSQL West - Seattle 2009
  • 24. Summary and Questions © Continuent 2009 PostgreSQL West - Seattle 2009
  • 25. Summary / Changing technology and user needs are reshaping clustering / Continuent Tungsten clusters solve new needs more effectively than other clustering approaches / Check out what we are doing and provide feedback © Continuent 2009 PostgreSQL West - Seattle 2009
  • 26. Contact Information HQ and Americas EMEA and APAC 560 S. Winchester Blvd., Suite 500 Lars Sonckin kaari 16 San Jose, CA 95128 02600 Espoo, Finland Tel (866) 998-3642 Tel +358 50 517 9059 Fax (408) 668-1009 Fax +358 9 863 0060 e-mail: robert dot hodges at continuent dot com Continuent Web Site: http://www.continuent.com 2ndQuadrant Web Site: http://www.2ndquadrant.com © Continuent 2009 PostgreSQL West - Seattle 2009