Mais conteĂșdo relacionado Semelhante a Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In Real Time From MySQL To Oracle (20) Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In Real Time From MySQL To Oracle1. How Gittigidiyor (a subsidiary of eBay)
Replicates Data In Real Time
From MySQL To Oracle
Levent Kurt, Site Operations Manager, Gittigidiyor
Giuseppe Maxia, Director of Quality Assurance, Continuent
Linas Virbalas, Senior Software Engineer, Continuent
©Continuent 2013.
2. Introducing Continuent
âą
The leading provider of clustering and
replication for open source DBMS
âą
Our Product: Continuent Tungsten
âą Clustering - Commercial-grade HA, performance
scaling and data management for MySQL
âą Replication - Flexible, high-performance data
movement
©Continuent 2013
2
9. Steps to Heterogeneous Replication
1. Prepare (translate) schema for
the slave DBMS
2. Set up replication
ddlscan
tpm
3. Provision initial dataâš
âš
MySQL Blackhole
Parallel Apply
4. Continue real-time replication
Tungsten Replicator
©Continuent 2013
11. Use Case: Real-Time Sales/Order
Fulfillment
Web-based Sales
~1M
Xacts/
Day
©Continuent 2013
Purchase Ordering
Real-Time Replication
3M
Order
Items
15. Translating Schema
âą
Beginning - how to convert tables?
empty
âąData types?
âąColumn lengths?
âąNaming conventions?
âąReserved words?
Tables
©Continuent 2013
15
18. Usage (MySQL to Oracle Example)
$ cd tungsten-replicator/bin
!
$ ./ddlscan
-db test
-template ddl-mysql-oracle.vm
-user tungsten
-pass secret
©Continuent 2013
18
21. Result of ddlscan
CREATE TABLE 3colors
/* ERROR: table starts with a number, use rename option and a
filter */
(
id NUMBER(10, 0),
color VARCHAR2(1) /* ENUM('R','G','B') */,
enabled NUMBER(1) /* BIT(1) - no constraints for 0 or 1 */,
acolumnthatdoesntfittooracleat NUMBER(10, 0)
/* WARN: truncated column name exceeding 30 characters
(acolumnthatdoesntfittooracleatall) */
!
/* ERROR: table must have a primary key! */
);
!
CREATE TABLE talks
...
©Continuent 2013
21
25. Replicator Installation
./tools/tpm configure my_ora
--enable-heterogenous-service=true
--install-directory=/opt/mysql_to_ora/continuent
--members=alpha,bravo
--master=alpha
!
./tools/tpm configure my_ora --hosts=alpha
--replication-user=tungsten
--replication-password=secret
!
./tools/tpm configure my_ora --hosts=bravo
--replication-user=tungsten_frommysql
--replication-password=secret
--datasource-type=oracle
--datasource-oracle-service=ORCL
--svc-applier-filters=dropstatementdata
!
./tools/tpm install my_ora
!
./tools/tpm start my_ora
!
©Continuent 2013
25
26. Replication Under the Hood
MySQLExtractor
OracleApplier
Tungsten Master
Replicator
Service
frommysql
MySQL
Binlog
binlog_format=row
©Continuent 2013
Tungsten Slave
Replicator
Service
frommysql
MySQLExtractor
Special Filters
âą Transform
ENUM to string
âą Transform SET
to string
Special Filters
âą Drop DDL
âą Map names to upper case
âą Rename too long or reserved
objects
âą Optimize updates to remove
unchanged columns
âą Ignore extra tables
26
28. The Requirements
âą
Export data from MySQL master to the
Oracle slave before starting replication
âą
The Oracle slave should also take trace of the
changes
âą
Convert the MySQL tables to stream of raw
data in THL format
âą
Data is about 400 GB
©Continuent 2013
28
29. The Practical Steps
1. Export data from master
2. Keep track of replication position
3. Start the replicator from the sandbox
4. Load data into slave with parallel apply
5. Switch replicator to real master
6. Dismiss the sandbox
7. Replication from MySQL to Oracle live
©Continuent 2013
29
35. How Parallel Apply Works
Pipeline
Stage
Stage
Filter
Extract
Apply
(Shard)
Stage
Extract/Filter/Apply
Extract/Filter/Apply
Extract/Filter/Apply
Extract/Filter/
Apply
Parallel
Queue
Master
DBMS
©Continuent 2013
Transaction
History Log
Provisioning
Mutlitenant
source
Slave
DBMS
39. âą Gittigidiyor
âą
âą
âą
âą
âą
âą
âą
âą
A subsidiary of eBay
Founded in 2001, joined the eBay family in June 2011
Most widely-used e-shopping site in Turkey
More than 9 million registered users
Over 900 thousand daily visitors and
5 million listings at any given time.
700 thousand sellers all around Turkey
Selling 1 item every 3 seconds
©Continuent 2013
1
41. Tungsten Solution
!
âą DDL generation
âą Replication to Oracle master
âą Handling data correctly
âą CDC generation
âą Fail-safe
Rep
licat
Master
ion
Tungsten
Replication
Replicator
Tungsten
Filters
ETL
ORA Master
ORA CDC
©Continuent 2013
41
ORA DWH
42. The steps we took
!
1. Proof of Concept
a. replicated 5 tables
b. created the DDL
Generator.
2. Set up the replication to
Oracle Master
3. Set up filters for Oracle
CDC generation.
4. Dumped all data in MySQL
Master and MySQL CDC to
Oracle equivalents.
Rep
licat
Master
ion
Tungsten
Replication
Replicator
Tungsten
Filters
ETL
ORA Master
ORA CDC
©Continuent 2013
42
ORA DWH
44. Support for Tungsten Replicator
âą
Community support is available on project
mailing list
âą
Continuent offers implementation services and
annual 24/7 support subscriptions
âą
For high availability or disaster recovery needs,
check out Continuent Tungsten clustering
âą
Meanwhile, have fun and try it out!
©Continuent 2013
44
45. 560 S. Winchester Blvd., Suite 500
San Jose, CA 95128
Tel +1 (866) 998-3642
Fax +1 (408) 668-1009
e-mail: sales@continuent.com
Our Blogs:
http://flyingclusters.blogspot.com
http://scale-out-blog.blogspot.com
http://datacharmer.blogspot.com
http://continuent-tungsten.blogspot.com
Continuent Web Page:
http://www.continuent.com
!
Tungsten Replicator:
http://tungsten-replicator.org
©Continuent 2013
45