Linas Virbalas Continuent, Inc.



Similar documents
How, What, and Where of Data Warehouses for MySQL

From Dolphins to Elephants: Real-Time MySQL to Hadoop Replication with Tungsten

Replicating to everything

Tungsten Replicator, more open than ever!

How To Create A Table In Sql (Ahem)

Parallel Replication for MySQL in 5 Minutes or Less

MS ACCESS DATABASE DATA TYPES

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Solving Large-Scale Database Administration with Tungsten

The Future of PostgreSQL High Availability Robert Hodges - Continuent, Inc. Simon Riggs - 2ndQuadrant

Database Migration from MySQL to RDM Server

Informatica Data Replication FAQs

Comparing SQL and NOSQL databases

Comparing MySQL and Postgres 9.0 Replication

Database Administration with MySQL

Information Technology NVEQ Level 2 Class X IT207-NQ2012-Database Development (Basic) Student s Handbook

Microsoft SQL Server to Infobright Database Migration Guide

!"# $ %& '( ! %& $ ' &)* + ! * $, $ (, ( '! -,) (# *&23. mysql> select * from from clienti;

MySQL for Beginners Ed 3

A Brief Introduction to MySQL

Welcome to Virtual Developer Day MySQL!

4 Logical Design : RDM Schema Definition with SQL / DDL

Database Schema Deployment. Lukas Smith - lukas@liip.ch CodeWorks PHP on the ROAD

sqlite driver manual

Services. Relational. Databases & JDBC. Today. Relational. Databases SQL JDBC. Next Time. Services. Relational. Databases & JDBC. Today.

Extracting META information from Interbase/Firebird SQL (INFORMATION_SCHEMA)

2/3/04 Doc 7 SQL Part 1 slide # 1

New Features in MySQL 5.0, 5.1, and Beyond

Database Replication with MySQL and PostgreSQL

COSC 6397 Big Data Analytics. 2 nd homework assignment Pig and Hive. Edgar Gabriel Spring 2015

SQL Server An Overview

Preventing con!icts in Multi-master replication with Tungsten

Chapter 9 Java and SQL. Wang Yang wyang@njnet.edu.cn

php tek 2006 in Orlando Florida Lukas Kahwe Smith

Implementing the Future of PostgreSQL Clustering with Tungsten

Using MySQL for Big Data Advantage Integrate for Insight Sastry Vedantam

Shadowbase Data Replication Solutions. William Holenstein Senior Manager of Product Delivery Shadowbase Products Group

SQL. Short introduction

Oracle Data Integration Solutions GoldenGate New Features Summary

Overview of Databases On MacOS. Karl Kuehn Automation Engineer RethinkDB

High Availability Solutions for the MariaDB and MySQL Database

Create a Database Driven Application

Real-time Data Replication

Preparing for the Big Oops! Disaster Recovery Sites for MySQL. Robert Hodges, CEO, Continuent MySQL Conference 2011

Sharding with postgres_fdw

Advanced SQL. Jim Mason. Web solutions for iseries engineer, build, deploy, support, train

Testing and Verifying your MySQL Backup Strategy

SOLUTION BRIEF. JUST THE FAQs: Moving Big Data with Bulk Load.

Why Zalando trusts in PostgreSQL

Oracle to MySQL Migration

DBMS / Business Intelligence, SQL Server

Lab 2: PostgreSQL Tutorial II: Command Line

Not Your Grandpa s Replication

Zero Downtime Deployments with Database Migrations. Bob Feldbauer

Future-Proofing MySQL for the Worldwide Data Revolution

Database migration. from Sybase ASE to PostgreSQL. Achim Eisele and Jens Wilke. 1&1 Internet AG

Postgres Plus xdb Replication Server with Multi-Master User s Guide

B.1 Database Design and Definition

An Oracle White Paper November Leveraging Massively Parallel Processing in an Oracle Environment for Big Data Analytics

Real-time reporting at 10,000 inserts per second. Wesley Biggs CTO 25 October 2011 Percona Live

Intro to Databases. ACM Webmonkeys 2011

Microsoft SQL Database Administrator Certification

Conventional Files versus the Database. Files versus Database. Pros and Cons of Conventional Files. Pros and Cons of Databases. Fields (continued)

DocStore: Document Database for MySQL at Facebook. Peng Tian, Tian Xia 04/14/2015

SharePlex for SQL Server

Using SQL Server Management Studio

Comparison of Open Source RDBMS

IT2304: Database Systems 1 (DBS 1)

Heterogeneous Replication Guide. SAP Replication Server SP200

Systems Infrastructure for Data Science. Web Science Group Uni Freiburg WS 2012/13

Agenda. ! Strengths of PostgreSQL. ! Strengths of Hadoop. ! Hadoop Community. ! Use Cases

MySQL and Hadoop: Big Data Integration. Shubhangi Garg & Neha Kumari MySQL Engineering

PostgreSQL Past, Present, and Future EDB All rights reserved.

Geodatabase Programming with SQL

Unifying the Global Data Space using DDS and SQL

VMware Continuent. Benefits and Configurations TECHNICAL WHITE PAPER

Apache Cassandra Query Language (CQL)

ODBC Client Driver Help Kepware, Inc.

EMBL-EBI. Database Replication - Distribution

SQL injection: Not only AND 1=1. The OWASP Foundation. Bernardo Damele A. G. Penetration Tester Portcullis Computer Security Ltd


database abstraction layer database abstraction layers in PHP Lukas Smith BackendMedia

Module 14: Scalability and High Availability

DBA Tutorial Kai Voigt Senior MySQL Instructor Sun Microsystems Santa Clara, April 12, 2010

A basic create statement for a simple student table would look like the following.

Adam Rauch Partner, LabKey Software Extending LabKey Server Part 1: Retrieving and Presenting Data

2874CD1EssentialSQL.qxd 6/25/01 3:06 PM Page 1 Essential SQL Copyright 2001 SYBEX, Inc., Alameda, CA

Getting started with PostgreSQL

Securing Your Microsoft SQL Server Databases in an Enterprise Environment

A Migration Methodology of Transferring Database Structures and Data

Virtuoso Replication and Synchronization Services

Information Systems SQL. Nikolaj Popov

An Oracle White Paper June Migrating Applications and Databases with Oracle Database 12c

IT2305 Database Systems I (Compulsory)

Transcription:

Linas Virbalas Continuent, Inc.

Heterogeneous Replication Replication between different types of DBMS

/ Introductions / What is Tungsten (the whole stack)? / A Word About MySQL Replication / Tungsten Replicator: MySQL to PostgreSQL/ Greenplum / Demo! / Questions and Answers

/ 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

/ 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 US/European presence Deep experience in replication, distributed systems, and RDBMS

What is Tungsten and How Does It Work?

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

Apache/Mod_PHP Apache/Mod_PHP Connector Connector Replicator Manager Replicator Manager Replicator Manager

So Why Are We Here?

Why Would You Want to Do That? / Feed MySQL web transactions to PostgreSQL applications / Feed PG/GP-based data warehouse and reporting / Migrate MySQL data to PG with minimum downtime / Leveraging SQL power of PostgreSQL

Slave readable Slave 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

/ Statement Based Replication / Row Based Replication

MySQL Statement Based MySQL Row Based MySQL Mixed PostgreSQL WAL Shipping PostgreSQL Streaming Replication Logical x x x Physical Filters (data transformation) possible + - Different data/structure on slave possible x x + -

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

Technology: Replication Pipelines

Master Replicator Transaction History Log Filters MySQL Extractor Slave Replicator Transaction History Log Filters PostgreSQL Applier

/ 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 / Case Sensitivity / Old Versions of MySQL

Provisioning / Harder way: Dump data explicitly / Easier way: Replicate a mysqldump backup Replicator

/ 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, treated as BLOB) TEXT (treated as TEXT)! BLOB BYTEA

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! / <MySQL>.DatabaseMetaData.getColumns (schemaname, null, tablename, null) vs. <PG>.DatabaseMetaData.getColumns (dbname, schemaname, tablename, null)! / Tungsten has logic and filters to rectify MySQL databases to PostgreSQL schemas

/ 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 ;

/ 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 CREATE TABLE complex (id INTEGER AUTO_INCREMENT PRIMARY KEY, i INT);! PostgreSQL CREATE TABLE complex (id SERIAL PRIMARY KEY, i INT);! CREATE TABLE dt (i TINYINT);! CREATE TABLE dt (i SMALLINT);!

/ 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 INSERT INTO embedded_blob (key, data) VALUES (1,? \0^Es\0^\0\ )! CREATE TABLE xlate(id int, d1 varchar(25) character set latin1, d2 varchar(25) character set utf8);! PostgreSQL ARGH!!! (SQL statement fails) ARGH!!! (no way to translate to common charset)

/ MySQL case sensitivity differs: Table name case sensitivity depends on platform Column names are not case sensitive / PostgreSQL: column and table names are case sensitive / Answer: Enclose object names in double quotes under PostgreSQL MySQL INSERT INTO test.users (firstname, familyname)! INSERT INTO test. users" ( firstname", familyname )! PostgreSQL ERROR: column "firstname" of relation users" does not exist Success!

MySQL Versions / Problem: Data stored on hard-to-replicate MySQL versions or configurations Row replication not enabled (5.1) No row replication support (5.0, 4.1) Tungsten cannot read binlog (4.1) / Answer: MySQL blackhole replication (Blackhole = no store, just a binlog) Caveat: Check MySQL docs carefully Replicator

What s Left? / We have covered the basics but there is more / Greenplum: events must be skinned to not update the Distribution Key (OptimizeUpdatesFilter) / Data transformation (more Javascript filtering) / Making it go *really* fast (think parallel replication)

Open Source http://tungsten-replicator.org #tungsten @ irc.freenode.net Commercial sales@continuent.com My Blog: http://flyingclusters.blogspot.com Continuent Web Site: http://www.continuent.com