SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
Linas Virbalas
                    Continuent, Inc.



© Continuent 2010
/  Definition & Motivation
  /  Three Stories
  /  How?
  /  Questions and Answers




© Continuent 2010
© Continuent 2010
Heterogeneous Replication
                               
       Replication between different types of DBMS




© Continuent 2010
1.  Real-time integration of data between different DBMS
      types
  2.  Seamless migration out of one DBMS type to another
  3.  Data warehousing (real-time) from different DBMS
      types




© Continuent 2010
/        Name: Linas Virbalas
  /        Country: Lithuania
  /        Implementing for Tungsten:
         •          MySQL -> PostgreSQL
         •          MySQL -> Greenplum
         •          MySQL -> Oracle
         •          PostgreSQL WAL
         •          PostgreSQL Streaming Replication
         •          PostgreSQL Logical Replication
                    via Slony logs


  /        Blog:
           http://flyingclusters.blogspot.com


© Continuent 2010
© Continuent 2010
1.  Story of MySQL -> …
         •          How to replicate from MySQL to PostgreSQL/Greenplum?
                    Oracle?
  2.  Story of PostgreSQL -> PostgreSQL
         •          Advanced Logical Replication
  3.  Story of PostgreSQL -> …
         •          For now: how to replicate from PostgreSQL to MySQL




© Continuent 2010
With Tungsten Replicator
                             Why?

                       Because It Can! :)




© Continuent 2010
/        Interfaces to implement new:
         •          Extractors
         •          Filters
         •          Appliers
  /        Multiple replication services per one process
  /        JAVA
  /        Open Source GPL v2




© Continuent 2010
Technology: Replication Pipelines




© Continuent 2010
© Continuent 2010
/  Statement Based Replication




  /  Row Based Replication




© Continuent 2010
© Continuent 2010
Tungsten     Tungsten
                    Replicator   Replicator




© Continuent 2010
Master         Slave
                    Replicator    Replicator

                    Transaction   Transaction
                    History Log   History Log
                      Filters       Filters
                     MySQL        PostgreSQL
                     Extractor      Applier




© Continuent 2010
/  Provisioning
  /  Data Type Differences
  /  Database vs. Schema
  /  Default (Implicitly Defined) Schema Selection
  /  SQL Dialect Differences
           •  Statement Replication vs. Row Replication
  /  Character Sets and Binary Data
  /  Old Versions of MySQL




© Continuent 2010
Provisioning

 /  Harder way: Dump data explicitly




 /  Easier way: Replicate a mysqldump backup



                          Replicator




© Continuent 2010
/  Note the type differences between MySQL and PG

                        MySQL                PostgreSQL
                    !   TINYINT              SMALLINT
                        SMALLINT             SMALLINT
                        INTEGER              INTEGER
                        BIGINT               BIGINT
                    !   CHAR(1)              CHAR(5) = {‘true’, ‘false’}
                        CHAR(x)              CHAR(x)
                        VARCHAR(x)           VARCHAR(x)
                        DATE                 DATE
                        TIMESTAMP            TIMESTAMP
                    !   TEXT (diff. sizes)   TEXT
                    !   BLOB                 BYTEA
                        …
© Continuent 2010
Database vs. Schema

  /  In MySQL these are the same:
    ! !CREATE DATABASE foo!
    ! !CREATE SCHEMA foo!
  /  In PostgreSQL these are very different:
                    CREATE DATABASE foo!
    ! !CREATE SCHEMA foo!
  /  Tungsten uses filters to rectify MySQL databases to
     PostgreSQL schemas




© Continuent 2010
/  MySQL: Trivial to use `USE`
  /  MySQL: Going without `USE` generates different
     events
                        MySQL Implicit            MySQL Explicit
                        CREATE SCHEMA s;          CREATE SCHEMA s;
                        USE s;
                    !   CREATE TABLE t (i int);   CREATE TABLE s.t (i int);
                    !   INSERT INTO t (1);        INSERT INTO s.t (1);


  /  PG: Extract the default schema from the event
  /  PG: Set it before applying
                    MySQL            PostgreSQL
                    USE s;       >   SET search_path TO s, "$user”;
© Continuent 2010
/  Differences between DDL and DML statement SQL
     dialects
  /  Row Replication resolves issues rising from
     differences in DML, but still leaves DDL to handle
  /  Tungsten Replicator Filters come to the rescue!
           •  Simple to develop Java or JavaScript extensions
           •  Event structure IN -> Filter -> Event structure OUT

          MySQL                          PostgreSQL
          CREATE TABLE complex (id       CREATE TABLE complex (id
          INTEGER AUTO_INCREMENT         SERIAL PRIMARY KEY, i INT);
          PRIMARY KEY, i INT);

          CREATE TABLE dt (i TINYINT);    CREATE TABLE dt (i SMALLINT);
          …


© Continuent 2010
/  Statement replication: MySQL syntax is “permissive”
      /  Embedded binary / alternate charsets
      /  Different charsets for different clients
  /  Row replication: database/table/column charsets
     may differ
  /  Answer: Stick with one character set throughout; use
     row replication to move binary data
          MySQL                           PostgreSQL
          INSERT INTO embedded_blob ARGH!!! (SQL statement fails)
          (key, data) VALUES (1, ‘?0^Es
          0^0’’)
          create table xlate(id int, d1   ARGH!!! (no way to translate to
          varchar(25) character set       common charset)
          latin1, d2 varchar(25)
          character set utf8);
© Continuent 2010
© Continuent 2010
© Continuent 2010
Logical   Physical
                           MySQL Statement Based           x
                                 MySQL Row Based           x
                                      MySQL Mixed          x
                         PostgreSQL WAL Shipping                     x
                PostgreSQL Streaming Replication                     x
               Filters (data transformation) possible     +          -
                    Different data/structure on slave     +          -
                                             possible

  /  A transaction is not accessible to the replicator under
     physical replication
  /  Tungsten Replicator manages WAL/Streaming
     Replication

© Continuent 2010
Logical   Physical
                           MySQL Statement Based           x
                                 MySQL Row Based           x
                                      MySQL Mixed          x
                         PostgreSQL WAL Shipping                     x
                PostgreSQL Streaming Replication                     x
                           Tungsten Replicator w/          x
                        PostgreSQLSlonyExtractor
               Filters (data transformation) possible     +          -
                    Different data/structure on slave     +          -
                                             possible

  /  With PostgreSQLSlonyExtractor transaction goes
     through the Replicator pipeline


© Continuent 2010
Master           Slave
 Replicator      Replicator

 Transaction     Transaction
 History Log     History Log
   Filters         Filters
 PostgreSQL
SlonyExtractor
© Continuent 2010
© Continuent 2010
Master           Slave
 Replicator      Replicator

 Transaction     Transaction
 History Log     History Log
   Filters          Filters
 PostgreSQL      MySQLApplier
SlonyExtractor
© Continuent 2010
© Continuent 2010
© Continuent 2010
Open Source                      Commercial
   http://tungsten-replicator.org   sales@continuent.com
   #tungsten @ irc.freenode.net

   My Blog:
   http://flyingclusters.blogspot.com



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


© Continuent 2010

Weitere ähnliche Inhalte

Was ist angesagt?

MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用iammutex
 
My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)Nicholas Adu Gyamfi
 
Parallel programming patterns - Олександр Павлишак
Parallel programming patterns - Олександр ПавлишакParallel programming patterns - Олександр Павлишак
Parallel programming patterns - Олександр ПавлишакIgor Bronovskyy
 
Bay area Cassandra Meetup 2011
Bay area Cassandra Meetup 2011Bay area Cassandra Meetup 2011
Bay area Cassandra Meetup 2011mubarakss
 
Instalación y Configuración : Bases de datos fuera del asistente
Instalación y Configuración : Bases de datos fuera del asistente Instalación y Configuración : Bases de datos fuera del asistente
Instalación y Configuración : Bases de datos fuera del asistente SolidQ
 
VLDB 2009 Tutorial on Column-Stores
VLDB 2009 Tutorial on Column-StoresVLDB 2009 Tutorial on Column-Stores
VLDB 2009 Tutorial on Column-StoresDaniel Abadi
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Rittercatherinewall
 

Was ist angesagt? (7)

MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用MongoDB 在盛大大数据量下的应用
MongoDB 在盛大大数据量下的应用
 
My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)My SQL Portal Database (Cluster)
My SQL Portal Database (Cluster)
 
Parallel programming patterns - Олександр Павлишак
Parallel programming patterns - Олександр ПавлишакParallel programming patterns - Олександр Павлишак
Parallel programming patterns - Олександр Павлишак
 
Bay area Cassandra Meetup 2011
Bay area Cassandra Meetup 2011Bay area Cassandra Meetup 2011
Bay area Cassandra Meetup 2011
 
Instalación y Configuración : Bases de datos fuera del asistente
Instalación y Configuración : Bases de datos fuera del asistente Instalación y Configuración : Bases de datos fuera del asistente
Instalación y Configuración : Bases de datos fuera del asistente
 
VLDB 2009 Tutorial on Column-Stores
VLDB 2009 Tutorial on Column-StoresVLDB 2009 Tutorial on Column-Stores
VLDB 2009 Tutorial on Column-Stores
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Ritter
 

Andere mochten auch

Jena University Talk 2016.03.09 -- SQL at Zalando Technology
Jena University Talk 2016.03.09 -- SQL at Zalando TechnologyJena University Talk 2016.03.09 -- SQL at Zalando Technology
Jena University Talk 2016.03.09 -- SQL at Zalando TechnologyValentine Gogichashvili
 
Adding replication protocol support for psycopg2
Adding replication protocol support for psycopg2Adding replication protocol support for psycopg2
Adding replication protocol support for psycopg2Alexander Shulgin
 
Do postgres-dream-of-graph-database
Do postgres-dream-of-graph-databaseDo postgres-dream-of-graph-database
Do postgres-dream-of-graph-databaseToshi Harada
 
Fun Things to do with Logical Decoding
Fun Things to do with Logical DecodingFun Things to do with Logical Decoding
Fun Things to do with Logical DecodingMike Fowler
 
PostgreSQL 9.4 and Beyond @ FOSSASIA 2015 Singapore
PostgreSQL 9.4 and Beyond @ FOSSASIA 2015 SingaporePostgreSQL 9.4 and Beyond @ FOSSASIA 2015 Singapore
PostgreSQL 9.4 and Beyond @ FOSSASIA 2015 SingaporeSatoshi Nagayasu
 
Geographically Distributed PostgreSQL
Geographically Distributed PostgreSQLGeographically Distributed PostgreSQL
Geographically Distributed PostgreSQLmason_s
 

Andere mochten auch (8)

Jena University Talk 2016.03.09 -- SQL at Zalando Technology
Jena University Talk 2016.03.09 -- SQL at Zalando TechnologyJena University Talk 2016.03.09 -- SQL at Zalando Technology
Jena University Talk 2016.03.09 -- SQL at Zalando Technology
 
Adding replication protocol support for psycopg2
Adding replication protocol support for psycopg2Adding replication protocol support for psycopg2
Adding replication protocol support for psycopg2
 
Do postgres-dream-of-graph-database
Do postgres-dream-of-graph-databaseDo postgres-dream-of-graph-database
Do postgres-dream-of-graph-database
 
Fun Things to do with Logical Decoding
Fun Things to do with Logical DecodingFun Things to do with Logical Decoding
Fun Things to do with Logical Decoding
 
PostgreSQL 9.4 and Beyond @ FOSSASIA 2015 Singapore
PostgreSQL 9.4 and Beyond @ FOSSASIA 2015 SingaporePostgreSQL 9.4 and Beyond @ FOSSASIA 2015 Singapore
PostgreSQL 9.4 and Beyond @ FOSSASIA 2015 Singapore
 
kafka for db as postgres
kafka for db as postgreskafka for db as postgres
kafka for db as postgres
 
Geographically Distributed PostgreSQL
Geographically Distributed PostgreSQLGeographically Distributed PostgreSQL
Geographically Distributed PostgreSQL
 
PostgreSQL 9.4
PostgreSQL 9.4PostgreSQL 9.4
PostgreSQL 9.4
 

Ähnlich wie Flexible Replication

Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Continuent
 
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsReplicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsLinas Virbalas
 
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsReplicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsContinuent
 
Implementing the Future of PostgreSQL Clustering with Tungsten
Implementing the Future of PostgreSQL Clustering with TungstenImplementing the Future of PostgreSQL Clustering with Tungsten
Implementing the Future of PostgreSQL Clustering with TungstenCommand Prompt., Inc
 
Performance evaluation of cloudera impala 0.6 beta with comparison to Hive
Performance evaluation of cloudera impala 0.6 beta with comparison to HivePerformance evaluation of cloudera impala 0.6 beta with comparison to Hive
Performance evaluation of cloudera impala 0.6 beta with comparison to HiveYukinori Suda
 
Real-Time Data Loading from MySQL to Hadoop with New Tungsten Replicator 3.0
Real-Time Data Loading from MySQL to Hadoop with New Tungsten Replicator 3.0Real-Time Data Loading from MySQL to Hadoop with New Tungsten Replicator 3.0
Real-Time Data Loading from MySQL to Hadoop with New Tungsten Replicator 3.0Continuent
 
Database Performance With Proxy Architectures
Database  Performance With  Proxy  ArchitecturesDatabase  Performance With  Proxy  Architectures
Database Performance With Proxy ArchitecturesPerconaPerformance
 
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 ReplicatorsContinuent
 
Built-in Replication in PostgreSQL
Built-in Replication in PostgreSQLBuilt-in Replication in PostgreSQL
Built-in Replication in PostgreSQLMasao Fujii
 
Tungsten University: Replicate Between MySQL And Oracle
Tungsten University: Replicate Between MySQL And OracleTungsten University: Replicate Between MySQL And Oracle
Tungsten University: Replicate Between MySQL And OracleContinuent
 
Five Lessons in Distributed Databases
Five Lessons  in Distributed DatabasesFive Lessons  in Distributed Databases
Five Lessons in Distributed Databasesjbellis
 
Riak add presentation
Riak add presentationRiak add presentation
Riak add presentationIlya Bogunov
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBXESUG
 
MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015
MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015
MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015Dave Stokes
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptxIvan Ma
 
Postgres Plus Advanced Server 9.2新機能ご紹介
Postgres Plus Advanced Server 9.2新機能ご紹介Postgres Plus Advanced Server 9.2新機能ご紹介
Postgres Plus Advanced Server 9.2新機能ご紹介Yuji Fujita
 
Drizzle Keynote from O'Reilly's MySQL's Conference
Drizzle Keynote from O'Reilly's MySQL's ConferenceDrizzle Keynote from O'Reilly's MySQL's Conference
Drizzle Keynote from O'Reilly's MySQL's ConferenceBrian Aker
 

Ähnlich wie Flexible Replication (20)

Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
 
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsReplicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
 
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to AnalyticsReplicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to Analytics
 
Implementing the Future of PostgreSQL Clustering with Tungsten
Implementing the Future of PostgreSQL Clustering with TungstenImplementing the Future of PostgreSQL Clustering with Tungsten
Implementing the Future of PostgreSQL Clustering with Tungsten
 
Performance evaluation of cloudera impala 0.6 beta with comparison to Hive
Performance evaluation of cloudera impala 0.6 beta with comparison to HivePerformance evaluation of cloudera impala 0.6 beta with comparison to Hive
Performance evaluation of cloudera impala 0.6 beta with comparison to Hive
 
Real-Time Data Loading from MySQL to Hadoop with New Tungsten Replicator 3.0
Real-Time Data Loading from MySQL to Hadoop with New Tungsten Replicator 3.0Real-Time Data Loading from MySQL to Hadoop with New Tungsten Replicator 3.0
Real-Time Data Loading from MySQL to Hadoop with New Tungsten Replicator 3.0
 
Database Performance With Proxy Architectures
Database  Performance With  Proxy  ArchitecturesDatabase  Performance With  Proxy  Architectures
Database Performance With Proxy Architectures
 
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
 
Built-in Replication in PostgreSQL
Built-in Replication in PostgreSQLBuilt-in Replication in PostgreSQL
Built-in Replication in PostgreSQL
 
Tungsten University: Replicate Between MySQL And Oracle
Tungsten University: Replicate Between MySQL And OracleTungsten University: Replicate Between MySQL And Oracle
Tungsten University: Replicate Between MySQL And Oracle
 
MySQL8.0 in COSCUP2017
MySQL8.0 in COSCUP2017MySQL8.0 in COSCUP2017
MySQL8.0 in COSCUP2017
 
Five Lessons in Distributed Databases
Five Lessons  in Distributed DatabasesFive Lessons  in Distributed Databases
Five Lessons in Distributed Databases
 
Riak add presentation
Riak add presentationRiak add presentation
Riak add presentation
 
NoSQL with MySQL
NoSQL with MySQLNoSQL with MySQL
NoSQL with MySQL
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
 
PostgreSQL replication
PostgreSQL replicationPostgreSQL replication
PostgreSQL replication
 
MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015
MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015
MySQL Workbench and Visual Explain -- RMUG Feb 19th 2015
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx
 
Postgres Plus Advanced Server 9.2新機能ご紹介
Postgres Plus Advanced Server 9.2新機能ご紹介Postgres Plus Advanced Server 9.2新機能ご紹介
Postgres Plus Advanced Server 9.2新機能ご紹介
 
Drizzle Keynote from O'Reilly's MySQL's Conference
Drizzle Keynote from O'Reilly's MySQL's ConferenceDrizzle Keynote from O'Reilly's MySQL's Conference
Drizzle Keynote from O'Reilly's MySQL's Conference
 

Kürzlich hochgeladen

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Kürzlich hochgeladen (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Flexible Replication

  • 1. Linas Virbalas Continuent, Inc. © Continuent 2010
  • 2. /  Definition & Motivation /  Three Stories /  How? /  Questions and Answers © Continuent 2010
  • 4. Heterogeneous Replication  Replication between different types of DBMS © Continuent 2010
  • 5. 1.  Real-time integration of data between different DBMS types 2.  Seamless migration out of one DBMS type to another 3.  Data warehousing (real-time) from different DBMS types © Continuent 2010
  • 6. /  Name: Linas Virbalas /  Country: Lithuania /  Implementing for Tungsten: •  MySQL -> PostgreSQL •  MySQL -> Greenplum •  MySQL -> Oracle •  PostgreSQL WAL •  PostgreSQL Streaming Replication •  PostgreSQL Logical Replication via Slony logs /  Blog: http://flyingclusters.blogspot.com © Continuent 2010
  • 8. 1.  Story of MySQL -> … •  How to replicate from MySQL to PostgreSQL/Greenplum? Oracle? 2.  Story of PostgreSQL -> PostgreSQL •  Advanced Logical Replication 3.  Story of PostgreSQL -> … •  For now: how to replicate from PostgreSQL to MySQL © Continuent 2010
  • 9. With Tungsten Replicator Why? Because It Can! :) © Continuent 2010
  • 10. /  Interfaces to implement new: •  Extractors •  Filters •  Appliers /  Multiple replication services per one process /  JAVA /  Open Source GPL v2 © Continuent 2010
  • 13. /  Statement Based Replication /  Row Based Replication © Continuent 2010
  • 15. Tungsten Tungsten Replicator Replicator © Continuent 2010
  • 16. Master Slave Replicator Replicator Transaction Transaction History Log History Log Filters Filters MySQL PostgreSQL Extractor Applier © Continuent 2010
  • 17. /  Provisioning /  Data Type Differences /  Database vs. Schema /  Default (Implicitly Defined) Schema Selection /  SQL Dialect Differences •  Statement Replication vs. Row Replication /  Character Sets and Binary Data /  Old Versions of MySQL © Continuent 2010
  • 18. Provisioning /  Harder way: Dump data explicitly /  Easier way: Replicate a mysqldump backup Replicator © Continuent 2010
  • 19. /  Note the type differences between MySQL and PG MySQL PostgreSQL ! TINYINT SMALLINT SMALLINT SMALLINT INTEGER INTEGER BIGINT BIGINT ! CHAR(1) CHAR(5) = {‘true’, ‘false’} CHAR(x) CHAR(x) VARCHAR(x) VARCHAR(x) DATE DATE TIMESTAMP TIMESTAMP ! TEXT (diff. sizes) TEXT ! BLOB BYTEA … © Continuent 2010
  • 20. Database vs. Schema /  In MySQL these are the same: ! !CREATE DATABASE foo! ! !CREATE SCHEMA foo! /  In PostgreSQL these are very different: CREATE DATABASE foo! ! !CREATE SCHEMA foo! /  Tungsten uses filters to rectify MySQL databases to PostgreSQL schemas © Continuent 2010
  • 21. /  MySQL: Trivial to use `USE` /  MySQL: Going without `USE` generates different events MySQL Implicit MySQL Explicit CREATE SCHEMA s; CREATE SCHEMA s; USE s; ! CREATE TABLE t (i int); CREATE TABLE s.t (i int); ! INSERT INTO t (1); INSERT INTO s.t (1); /  PG: Extract the default schema from the event /  PG: Set it before applying MySQL PostgreSQL USE s; > SET search_path TO s, "$user”; © Continuent 2010
  • 22. /  Differences between DDL and DML statement SQL dialects /  Row Replication resolves issues rising from differences in DML, but still leaves DDL to handle /  Tungsten Replicator Filters come to the rescue! •  Simple to develop Java or JavaScript extensions •  Event structure IN -> Filter -> Event structure OUT MySQL PostgreSQL CREATE TABLE complex (id CREATE TABLE complex (id INTEGER AUTO_INCREMENT SERIAL PRIMARY KEY, i INT); PRIMARY KEY, i INT); CREATE TABLE dt (i TINYINT); CREATE TABLE dt (i SMALLINT); … © Continuent 2010
  • 23. /  Statement replication: MySQL syntax is “permissive” /  Embedded binary / alternate charsets /  Different charsets for different clients /  Row replication: database/table/column charsets may differ /  Answer: Stick with one character set throughout; use row replication to move binary data MySQL PostgreSQL INSERT INTO embedded_blob ARGH!!! (SQL statement fails) (key, data) VALUES (1, ‘?0^Es 0^0’’) create table xlate(id int, d1 ARGH!!! (no way to translate to varchar(25) character set common charset) latin1, d2 varchar(25) character set utf8); © Continuent 2010
  • 26. Logical Physical MySQL Statement Based x MySQL Row Based x MySQL Mixed x PostgreSQL WAL Shipping x PostgreSQL Streaming Replication x Filters (data transformation) possible + - Different data/structure on slave + - possible /  A transaction is not accessible to the replicator under physical replication /  Tungsten Replicator manages WAL/Streaming Replication © Continuent 2010
  • 27. Logical Physical MySQL Statement Based x MySQL Row Based x MySQL Mixed x PostgreSQL WAL Shipping x PostgreSQL Streaming Replication x Tungsten Replicator w/ x PostgreSQLSlonyExtractor Filters (data transformation) possible + - Different data/structure on slave + - possible /  With PostgreSQLSlonyExtractor transaction goes through the Replicator pipeline © Continuent 2010
  • 28. Master Slave Replicator Replicator Transaction Transaction History Log History Log Filters Filters PostgreSQL SlonyExtractor
  • 31. Master Slave Replicator Replicator Transaction Transaction History Log History Log Filters Filters PostgreSQL MySQLApplier SlonyExtractor
  • 35. Open Source Commercial http://tungsten-replicator.org sales@continuent.com #tungsten @ irc.freenode.net My Blog: http://flyingclusters.blogspot.com Continuent Web Site: http://www.continuent.com © Continuent 2010