© Continuent 2010 Liberating Your Data From MySQL: Cross-Database Replication to the Rescue! Robert Hodges and Linas Virbalas Continuent, Inc.

Slides:



Advertisements
Similar presentations
Data Definition and Integrity Constraints
Advertisements

WaveMaker Visual AJAX Studio 4.0 Training
Mecanismos de alta disponibilidad con Microsoft SQL Server 2008 Por: ISC Lenin López Fernández de Lara.
Building a High-Volume Reporting System on Amazon AWS with MySQL, Tungsten, and Vertica GAMIFIED REWARDS
Day 3 - Basics of MySQL What is MySQL What is MySQL How to make basic tables How to make basic tables Simple MySQL commands. Simple MySQL commands.
CSE 190: Internet E-Commerce Lecture 10: Data Tier.
SQL DDL constraints Restrictions on the columns and tables 1SQL DDL Constraints.
SQL Overview Defining a Schema CPSC 315 – Programming Studio Spring 2008 Project 1, Lecture 3 Slides adapted from those used by Jeffrey Ullman, via Jennifer.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Module 14: Scalability and High Availability. Overview Key high availability features available in Oracle and SQL Server Key scalability features available.
DATABASES AND SQL. Introduction Relation: Relation means table(data is arranged in rows and columns) Domain : A domain is a pool of values appearing in.
Phil Brewster  One of the first steps – identify the proper data types  Decide how data (in columns) should be stored and used.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
DBMS 3. course. Reminder Data independence: logical and physical Concurrent processing – Transaction – Deadlock – Rollback – Logging ER Diagrams.
SQL Overview Defining a Schema CPSC 315 – Programming Studio Slides adapted from those used by Jeffrey Ullman, via Jennifer Welch Via Yoonsuck Choe.
Copyright © 2013 NetEase 马进 app DDB introduce.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
PostgreSQL and relational databases As well as assignment 4…
What is (Application) Clustering and Why do you Want to Use it? February 2005 Eero Teerikorpi CEO.
© Continuent 9/19/2015 PostgreSQL Lightning Talk Availability, Scaling, and more with Tungsten Stephane Giron and Gilles Rayrat PG Euro Prato Italy.
© Continuent 2010 Building Tungsten Clusters with PostgreSQL Hot Standby and Streaming Replication Linas Virbalas and Alex Alexander Continuent, Inc.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
Data: Migrating, Distributing and Audit Tracking Michelle Ayers, Advisory Solution Consultant
Forensic Audit Logging for PostgreSQL
Hive : A Petabyte Scale Data Warehouse Using Hadoop
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
Dbwebsites 2.1 Making Database backed Websites Session 2 The SQL… Where do we put the data?
MySQL. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn The main subsystems in MySQL architecture The different storage.
Hive Facebook 2009.
PostgreSQL and relational databases As well as assignment 4…
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Introduction to SQL.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 UNIT 6: Chapter 7: Introduction to SQL Modern Database Management 9 th Edition Jeffrey A.
Chapter 7 SQL HUANG XUEHUA. SQL SQL server2005 introduction Install components  management studio.
Chapter 4 Introduction to MySQL. MySQL “the world’s most popular open-source database application” “commonly used with PHP”
LIS651 lecture 6 mySQL Thomas Krichel
CSC 2720 Building Web Applications Database and SQL.
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
SQL Data Definition Language (DDL) Using Microsoft SQL Server 1SDL Data Definition Language (DDL)
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2015, Fred McClurg, All Rights.
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 7 (Part a): Introduction to SQL Modern Database Management 9 th Edition Jeffrey A.
Oracle® Streams for Near Real Time Asynchronous Replication Nimar S. Arora Oracle USA.
Distributed database system
Database Lab Lecture 1. Database Languages Data definition language ( DDL ) Data definition language –defines data types and the relationships among them.
Management Information Systems, 4 th Edition 1 Chapter 8 Data and Knowledge Management.
Visual Programing SQL Overview Section 1.
MGA Duplica Replication Tool. 1. High Availability and Avoidance of Data Loss  Replicate to alternate databases 2. Split activities across databases.
Week 8-9 SQL-1. SQL Components: DDL, DCL, & DML SQL is a very large and powerful language, but every type of SQL statement falls within one of three main.
DBMS 3. course. Reminder Data independence: logical and physical Concurrent processing – Transaction – Deadlock – Rollback – Logging ER Diagrams.
Basics of JDBC Session 14.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
HyperKVS Group Meeting Oracle Streams Dr. Volker Kuhr.
Aggregator Stage : Definition : Aggregator classifies data rows from a single input link into groups and calculates totals or other aggregate functions.
In the Name Of Almighty Allah. Java Application Connection To Mysql Created by Hasibullah (Sahibzada) Kabul Computer Science Faculty Afghanistan.
CSC314 DAY 8 Introduction to SQL 1. Chapter 6 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SQL OVERVIEW  Structured Query Language  The.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
 CONACT UC:  Magnific training   
CS320 Web and Internet Programming SQL and MySQL Chengyu Sun California State University, Los Angeles.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
Lecture 1.21 SQL Introduction Steven Jones, Genome Sciences Centre.
SQL - Training Rajesh Charles. Agenda (Complete Course) Introduction Testing Methodologies Manual Testing Practical Workshop Automation Testing Practical.
Plan for Final Lecture What you may expect to be asked in the Exam?
CS320 Web and Internet Programming SQL and MySQL
SQL OVERVIEW DEFINING A SCHEMA
MANAGING DATA RESOURCES
Cloud Data Replication with SQL Data Sync
SQL-1 Week 8-9.
CS3220 Web and Internet Programming SQL and MySQL
CS3220 Web and Internet Programming SQL and MySQL
Presentation transcript:

© Continuent 2010 Liberating Your Data From MySQL: Cross-Database Replication to the Rescue! Robert Hodges and Linas Virbalas Continuent, Inc.

© Continuent 2010 Agenda /Introductions /What is Tungsten? /A Word About MySQL Replication /Tungsten’s MySQL to PostgreSQL Replication /Demo! /Questions and Answers

© Continuent 2010 Introductions

About Continuent /Our Value: Make open source as robust as commercial databases Enterprise capability Cloud flexibility Open source cost /Our Solution: Tungsten Database Clustering /Our Company: Founded in Finland, HQ in USA Venture-backed US/European presence Deep experience in databases and distributed systems

© Continuent 2010 What is Tungsten and How Does It Work?

© Continuent 2010 What Is Tungsten? /Tungsten creates data services using off- the-shelf open source databases to: 1.Ensure reliable, fast access to data 2.Simplify common management tasks 3.Enable disaster recovery …Without changing applications

© Continuent 2010 Apache/Mod_PHP libmysqlclient.a Connector Tungsten 1.3 Data Service Architecture Apache/Mod_PHP DBMS Replicator Manager DBMS Replicator Manager DBMS Replicator Manager libmysqlclient.a Master Slave Slave Connector

© Continuent 2010 Technology: Replication Pipelines THL SlaveDBMS ApplierExtractorFiltersApplierExtractorFilters StageStage Pipeline Tungsten Replicator Process Transaction History Log Master THL (via network)

© Continuent 2010 So Why Are We Here? Tungsten can replicate in real time from MySQL to PostgreSQL

© Continuent 2010 Why Would You Want to Do That? /Feed MySQL merchant transactions to PostgreSQL applications /Feed PG-based data warehouse and reporting /Migrate MySQL data to PG with minimum downtime /Plus Scott McNealy says it’s good to share MySQL App 1 MySQL App 2 MySQL App 3 PG App

© Continuent 2010 A Word About MySQL Replication

© Continuent 2010 Writeable slaves Slave readableSlave writeable MySQL Statement Based++ MySQL Row Based++ MySQL Mixed++ PostgreSQL WAL Shipping-- PostgreSQL Streaming Replication (Hot Standby) +- /Tungsten for MySQL You can both read and write to the DB operating in slave mode This, potentially, allows you to break consistency In some scenarios that is a plus /Tungsten for PostgreSQL In Streaming Replication you can read from slaves Still, you cannot write to them In effect, you cannot have different data/structure on a slave

© Continuent 2010 Statement and Row Based Replication /Statement Based Replication /Row Based Replication CREATE TABLE t (id INT, name VARCHAR(12)); ALTER TABLE t ADD COLUMN id2 INT; INSERT INTO t VALUES (1, ‘Sun’, 999); UPDATE t SET name = ‘Moon’; CREATE TABLE t (id INT, name VARCHAR(12)); ALTER TABLE t ADD COLUMN id2 INT; { INSERT, t, (1, ‘Sun’, 999) }; { UPDATE, t, id == 1, (NULL, ‘Moon’, NULL) };

© Continuent 2010 Logical vs. Physical Replication LogicalPhysical MySQL Statement Basedx MySQL Row Basedx MySQL Mixedx PostgreSQL WAL Shippingx PostgreSQL Streaming Replicationx Filters (data transformation) possible+- Different data/structure on slave possible +-

© Continuent 2010 Tungsten MySQL -> PostgreSQL Replication

© Continuent 2010 MySQL -> PostgreSQL: Who’s Who? BinLogs Master DB (Binlogs enabled) Slave DB MySQL setup to run as MySQL master PostgreSQL setup to accept writes – Continuous Recovery is OFF

© Continuent 2010 MySQL -> PostgreSQL: Tungsten Replicator Doing the Job BinLogs Tungsten Replicator Platform- Independent SQL Events Log Record Master DB (Binlogs enabled) Slave DB JDBC SQL Requests

© Continuent 2010 MySQL -> PostgreSQL: Tungsten Replicator Components BinLogs Master Replicator MySQL Extractor Transaction History Log Slave Replicator PostgreSQL Applier Transaction History Log Platform- Independent SQL Events Log Record Master DB (Binlogs enabled) Slave DB JDBC SQL Requests Filters

© Continuent 2010 MySQL -> PostgreSQL: Challenges /Data Type Differences /Default (Implicitly Defined) Schema Selection /SQL Dialect Differences Statement Replication vs. Row Replication /Character Sets and Binary Data

© Continuent 2010 MySQL -> PostgreSQL: Data Types MySQLPostgreSQL !TINYINTSMALLINT INTEGER BIGINT !CHAR(1)CHAR(5) = {‘true’, ‘false’} CHAR(x) VARCHAR(x) DATE TIMESTAMP !TEXT (diff. sizes)TEXT !BLOBBYTEA … / /Note the type differences between MySQL and PG

© Continuent 2010 MySQL -> PostgreSQL: Default Schema MySQL ImplicitMySQL Explicit 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); / /MySQL: Trivial to use `USE` / /MySQL: Going without `USE` generates different events / /PG: Extract the default schema from the event / /PG: Set it before applying MySQLPostgreSQL USE s;>SET search_path TO s, "$user”;

© Continuent 2010 MySQL -> PostgreSQL: SQL Dialect MySQLPostgreSQL CREATE TABLE complex (id INTEGER AUTO_INCREMENT PRIMARY KEY, i INT); CREATE TABLE complex (id SERIAL PRIMARY KEY, i INT); CREATE TABLE dt (i TINYINT); CREATE TABLE dt (i SMALLINT); … / /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

© Continuent 2010 MySQL -> PostgreSQL: Charsets MySQLPostgreSQL INSERT INTO embedded_blob (key, data) VALUES (1, ‘ ?\0^Es\0^\0\’’) ARGH!!! (SQL statement fails) create table xlate(id int, d1 varchar(25) character set latin1, d2 varchar(25) character set utf8); ARGH!!! (no way to translate to common charset) / /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 if you need to move binary data

© Continuent 2010 MySQL-> PostgreSQL: What’s Left? /We have covered the basics but there is more… /Initial provisioning from MySQL to PostgreSQL /Data transformation /Making it go *really* fast (think parallel replication)

© Continuent 2010 DEMO

Q & A

© Continuent 2010 HQ and Americas 560 S. Winchester Blvd., Suite 500 San Jose, CA Tel (866) Fax (408) EMEA and APAC Lars Sonckin kaari Espoo, Finland Tel Fax Contact Information Continuent Web Site: