©Continuent 2012.Solving Large-Scale DatabaseAdministration with TungstenNeil Armitage, Sr. Software EngineerRobert Hodges...
©Continuent 2012Introducing Continuent2• The leading provider of clustering andreplication for open source DBMS• Our Produ...
©Continuent 2012Quick Continuent Facts• Largest Tungsten clustering installationprocesses about 500M transactions each day...
©Continuent 2012Select Continuent Customers4Sunday, 5 May 13
©Continuent 2012 5Why Tungsten?Sunday, 5 May 13
©Continuent 2012MySQL is a Great OLTP Database6But how do I...• Handle DBMS failures?• Perform maintenance and upgrades wi...
©Continuent 2012 7Tungsten Master/Slave ClusteringSunday, 5 May 13
©Continuent 2012Introducing Tungsten Clustering8Tungsten clusters combine o"-the-shelf open source DBMSservers into data s...
©Continuent 2012Doesn’t Replication Do This Already?9ApplicationLibmysqlclient.aApplicationLibmysqlclient.aReplicatorDb2Re...
©Continuent 2012Replication LimitationsReplication alone cannot enable constant accessto data...• What happens if the mast...
©Continuent 2012From Replicating to Clustering11ApplicationTungsten ConnectorApplicationTungsten ConnectorReplicatorDb2Rep...
©Continuent 2012Basic Cluster Operations12• Switch -- Promote a slave node to master• Shun -- Kick node out of cluster• We...
©Continuent 2012Automatic Failover13ApplicationTungsten ConnectorSunday, 5 May 13
©Continuent 2012Automatic Failover14ApplicationTungsten Connector1. Detect non-responsivemaster2. Halt master connectionsS...
©Continuent 2012Automatic Failover15ApplicationTungsten Connector3. Select most advancedslave and wait for pendingtransact...
©Continuent 2012Automatic Failover16ApplicationTungsten Connector4. Promote to master,reconfigure slave(s), andre-enable c...
©Continuent 2012Automatic Failover17ApplicationTungsten Connector5. Recover failed masterSunday, 5 May 13
©Continuent 2012Rolling SQL Schema Upgrade18Final UpgradeSwitchSlave Upgrade Slave Upgrade• Shun slave 1,run upgrade,and r...
©Continuent 2012Backup, Recovery, and Restore19• Backups/cluster	  >	  datasource	  DB1	  backup• Recover/cluster	  >	  da...
©Continuent 2012 20Understanding Tungsten ConnectivitySunday, 5 May 13
©Continuent 2012Tungsten Connector Basics• Any MySQL/PostgreSQL client can connect• Initiates connections using JDBC21App ...
©Continuent 2012Tungsten Connector Basics• Pass-through operation after connection• Full transparency & low overhead for c...
©Continuent 2012Simple Read/Write Splitting• Very fast, easy-to-understand scaling model• Transactions go to master• Auto-...
©Continuent 2012SmartScale Session Load Balancing24AppConnect/WriteConnectorTransactionHistory LogSlavereplaypositionSessi...
©Continuent 2012SmartScale Session Load Balancing24AppConnect/WriteConnectorTransactionHistory LogSlavereplaypositionSessi...
©Continuent 2012SmartScale Session Load Balancing25AppReadConnectorTransactionHistory LogSlavereplaypositionSession xSessi...
©Continuent 2012SmartScale Session Load Balancing25AppReadConnectorTransactionHistory LogSlavereplaypositionSession xSessi...
©Continuent 2012SmartScale Session Load Balancing26AppReadConnectorTransactionHistory LogSlavereplaypositionSession xSlave...
©Continuent 2012SmartScale Session Load Balancing26AppReadConnectorTransactionHistory LogSlavereplaypositionSession xSlave...
©Continuent 2012Tungsten DBMS Array Connectivity27AppRead/WriteConnectorcluster3 logincluster1 logincluster2 loginSunday, ...
©Continuent 2012Deployment on App Server Hosts28App Server+ ConnectorApp Server+ ConnectorApp Server+ ConnectorApp Server+...
©Continuent 2012Deployment on Dedicated Hosts29App Server App ServerApp Server App ServerApp ServerHardware Load BalancerS...
©Continuent 2012Deployment on Dedicated Hosts30App Server App ServerApp Server App ServerApp ServerSoftware Load BalancerS...
©Continuent 2012 31Managing Data Across Multiple SitesSunday, 5 May 13
©Continuent 2012Topics:• Tungsten Replicator basics• Disaster recovery sites• Multi-master topology• Fan-in32Sunday, 5 May...
©Continuent 2012Tungsten Replicator Overview33Master(Transactions + Metadata)SlaveTHLDBMSLogsReplicator(Transactions + Met...
©Continuent 2012Tungsten Replication Service34Extract Filter ApplyStageExtract Filter ApplyStageExtract Filter ApplyStageP...
©Continuent 2012Parallel Replication of Sharded Data35Extract Filter ApplyStageExtract Filter ApplyStageStagePipelineMaste...
©Continuent 2012Multiple Services Per Replicator36NYCReplicatorLondonService nycFrankfurtReplicatorService fraReplicatorSe...
©Continuent 2012Disaster Recovery Sites37• Updates go to primary site master• DR site receives updates in real time• Simpl...
©Continuent 2012Tungsten Composite Data Services38App Server+ ConnectorApp Server+ ConnectorMaster SlaveSan Jose New Yorks...
©Continuent 2012Switching and failover39• Planned switch/sj_nyc	  >	  switch	  to	  nyc• Failover/cluster	  >	  failover• ...
©Continuent 2012Multi-Master Replication40• Updates on 2+ sites (active-active mode)• Enables geographic distribution of d...
©Continuent 2012Simple Multi-Master Con!guration41NYC FrankfurtReplicatorfra (master)nyc (slave)Replicatorfra (slave)nyc (...
©Continuent 2012Complex Multi-Master Topologies42StarReplicationAllMastersSunday, 5 May 13
©Continuent 2012Fan-In Replication43• Multiple masters feed into a single slave• Use case: Aggregate data for reporting• C...
©Continuent 2012Fan-In Topology44Sunday, 5 May 13
©Continuent 2012 45Heterogeneous ReplicationSunday, 5 May 13
©Continuent 2012Problem: Real-Time Order Ful!llment46Real-Time ReplicationMySQLWeb-Facing Sales Purchase OrderingOraclePHP...
©Continuent 2012How Does Tungsten Do That?47MySQL Tungsten MasterReplicatorOracleService oracleMySQLExtractorSpecial Filte...
©Continuent 2012Batch Loading to Data Warehouses48CsvFileCsvFileCsvFile. . .LondonReplicatorService batchVerticaDataWareho...
©Continuent 2012Possibilities for Analytics...49OLTP DataMySQL MasterComplex, nearreal-timereportingLight-weight,real-time...
©Continuent 2012Getting Started50Sunday, 5 May 13
©Continuent 2012How Much Does Tungsten Cost?51• Continuent Tungsten Annual Subscription• $7,000 per DBMS, $3500 for hot st...
©Continuent 2012Consulting and ImplementationServices52• Delivered by clustering / replicationexperts• Wide range of consu...
©Continuent 2012How Do I Obtain Tungsten?53• Register at Continuent to get downloads for Oraclereplication:http://www.cont...
©Continuent 2012.Continuent Web Page:http://www.continuent.comTungsten Replicator 2.0:http://code.google.com/p/tungsten-re...
Upcoming SlideShare
Loading in...5
×

Solving large-scale-dba-admin-with-tungsten-2012-09-30

143
-1

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
143
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Solving large-scale-dba-admin-with-tungsten-2012-09-30

  1. 1. ©Continuent 2012.Solving Large-Scale DatabaseAdministration with TungstenNeil Armitage, Sr. Software EngineerRobert Hodges, CEOSunday, 5 May 13
  2. 2. ©Continuent 2012Introducing Continuent2• The leading provider of clustering andreplication for open source DBMS• Our Product: Continuent Tungsten• Clustering - Commercial-grade HA, performancescaling and data management for MySQL• Replication - Flexible, high-performance datamovementSunday, 5 May 13
  3. 3. ©Continuent 2012Quick Continuent Facts• Largest Tungsten clustering installationprocesses about 500M transactions each day• Tungsten Replicator was application of theyear at the 2011 MySQL User Conference• Continuent is well known in the MySQLcommunity for its clustering and replication• Over 90 customers currently deployed3Sunday, 5 May 13
  4. 4. ©Continuent 2012Select Continuent Customers4Sunday, 5 May 13
  5. 5. ©Continuent 2012 5Why Tungsten?Sunday, 5 May 13
  6. 6. ©Continuent 2012MySQL is a Great OLTP Database6But how do I...• Handle DBMS failures?• Perform maintenance and upgrades withouttaking applications o!ine?• Load balance SQL across replicas?• Create a disaster recovery site?• Set up multi-master replication?• Integrate with another DBMS?Sunday, 5 May 13
  7. 7. ©Continuent 2012 7Tungsten Master/Slave ClusteringSunday, 5 May 13
  8. 8. ©Continuent 2012Introducing Tungsten Clustering8Tungsten clusters combine o"-the-shelf open source DBMSservers into data services with:• 24x7 data access• Scaling of load on replicas• Simple management commands...without app changes or datamigrationAmazonUS Westapache/phpGonzoPortal.comConnector ConnectorSunday, 5 May 13
  9. 9. ©Continuent 2012Doesn’t Replication Do This Already?9ApplicationLibmysqlclient.aApplicationLibmysqlclient.aReplicatorDb2ReplicatorDb3Db1ReplicatorSlave SlaveMasterSunday, 5 May 13
  10. 10. ©Continuent 2012Replication LimitationsReplication alone cannot enable constant accessto data...• What happens if the master fails?• What happens if a slave is lagging too farbehind to be usable?• How do I maintain the DBMS without stoppingapps?10Sunday, 5 May 13
  11. 11. ©Continuent 2012From Replicating to Clustering11ApplicationTungsten ConnectorApplicationTungsten ConnectorReplicatorDb2ReplicatorDb3Db1ReplicatorSlave SlaveMasterManager Manager ManagerMonitoringandControlMonitoringandControlData Service: sjcSunday, 5 May 13
  12. 12. ©Continuent 2012Basic Cluster Operations12• Switch -- Promote a slave node to master• Shun -- Kick node out of cluster• Welcome -- Return node to cluster• Backup -- Run a backup• Restore -- [Re-]provision a node• Recover -- Return a broken node to slave• Heartbeat -- Check cluster livenessSunday, 5 May 13
  13. 13. ©Continuent 2012Automatic Failover13ApplicationTungsten ConnectorSunday, 5 May 13
  14. 14. ©Continuent 2012Automatic Failover14ApplicationTungsten Connector1. Detect non-responsivemaster2. Halt master connectionsSunday, 5 May 13
  15. 15. ©Continuent 2012Automatic Failover15ApplicationTungsten Connector3. Select most advancedslave and wait for pendingtransactions to applySunday, 5 May 13
  16. 16. ©Continuent 2012Automatic Failover16ApplicationTungsten Connector4. Promote to master,reconfigure slave(s), andre-enable connectionsSunday, 5 May 13
  17. 17. ©Continuent 2012Automatic Failover17ApplicationTungsten Connector5. Recover failed masterSunday, 5 May 13
  18. 18. ©Continuent 2012Rolling SQL Schema Upgrade18Final UpgradeSwitchSlave Upgrade Slave Upgrade• Shun slave 1,run upgrade,and return tocluster.Discard andrecover onfailure• Upgrade oldmaster.Clusterschema is nowfully upgraded• Repeat foradditionalslave(s)• Switchmaster topromote anupgradedslaveSunday, 5 May 13
  19. 19. ©Continuent 2012Backup, Recovery, and Restore19• Backups/cluster  >  datasource  DB1  backup• Recover/cluster  >  datasource  DB2  recover• Restore/cluster  >  datasource  DB2  restore• Out-of-box support for mysqldump/XtraBackup; simple integration for othersSunday, 5 May 13
  20. 20. ©Continuent 2012 20Understanding Tungsten ConnectivitySunday, 5 May 13
  21. 21. ©Continuent 2012Tungsten Connector Basics• Any MySQL/PostgreSQL client can connect• Initiates connections using JDBC21App NativeprotocolCOM_QUERYCOM_INIT_DBCOM_DROP_DBConnectorSunday, 5 May 13
  22. 22. ©Continuent 2012Tungsten Connector Basics• Pass-through operation after connection• Full transparency & low overhead for clients22AppProtocol packetCOM_QUERYselect * from tConnectorProtocol packetOKResultSet Rows:1Sunday, 5 May 13
  23. 23. ©Continuent 2012Simple Read/Write Splitting• Very fast, easy-to-understand scaling model• Transactions go to master• Auto-commit SELECTs go to slaves, ifavailable, but...• Reads potentially outdated data• Ephemeral SQL objects won’t be available• May miss: select update_function()23Sunday, 5 May 13
  24. 24. ©Continuent 2012SmartScale Session Load Balancing24AppConnect/WriteConnectorTransactionHistory LogSlavereplaypositionSession xSession ySlaveDBMSMasterDBMSSlaveDBMSSunday, 5 May 13
  25. 25. ©Continuent 2012SmartScale Session Load Balancing24AppConnect/WriteConnectorTransactionHistory LogSlavereplaypositionSession xSession ySlaveDBMSMasterDBMSSlaveDBMSSunday, 5 May 13
  26. 26. ©Continuent 2012SmartScale Session Load Balancing25AppReadConnectorTransactionHistory LogSlavereplaypositionSession xSession ySlaveDBMSMasterDBMSSlaveDBMSSunday, 5 May 13
  27. 27. ©Continuent 2012SmartScale Session Load Balancing25AppReadConnectorTransactionHistory LogSlavereplaypositionSession xSession ySlaveDBMSMasterDBMSSlaveDBMSSunday, 5 May 13
  28. 28. ©Continuent 2012SmartScale Session Load Balancing26AppReadConnectorTransactionHistory LogSlavereplaypositionSession xSlaveDBMSMasterDBMSSlaveDBMSSunday, 5 May 13
  29. 29. ©Continuent 2012SmartScale Session Load Balancing26AppReadConnectorTransactionHistory LogSlavereplaypositionSession xSlaveDBMSMasterDBMSSlaveDBMSSunday, 5 May 13
  30. 30. ©Continuent 2012Tungsten DBMS Array Connectivity27AppRead/WriteConnectorcluster3 logincluster1 logincluster2 loginSunday, 5 May 13
  31. 31. ©Continuent 2012Deployment on App Server Hosts28App Server+ ConnectorApp Server+ ConnectorApp Server+ ConnectorApp Server+ ConnectorApp Server+ ConnectorSunday, 5 May 13
  32. 32. ©Continuent 2012Deployment on Dedicated Hosts29App Server App ServerApp Server App ServerApp ServerHardware Load BalancerSunday, 5 May 13
  33. 33. ©Continuent 2012Deployment on Dedicated Hosts30App Server App ServerApp Server App ServerApp ServerSoftware Load BalancerSunday, 5 May 13
  34. 34. ©Continuent 2012 31Managing Data Across Multiple SitesSunday, 5 May 13
  35. 35. ©Continuent 2012Topics:• Tungsten Replicator basics• Disaster recovery sites• Multi-master topology• Fan-in32Sunday, 5 May 13
  36. 36. ©Continuent 2012Tungsten Replicator Overview33Master(Transactions + Metadata)SlaveTHLDBMSLogsReplicator(Transactions + Metadata)THLReplicatorDownloadtransactionsvia networkApply using JDBCSunday, 5 May 13
  37. 37. ©Continuent 2012Tungsten Replication Service34Extract Filter ApplyStageExtract Filter ApplyStageExtract Filter ApplyStagePipelineMasterDBMSTransactionHistory LogIn-MemoryQueueSlaveDBMSSunday, 5 May 13
  38. 38. ©Continuent 2012Parallel Replication of Sharded Data35Extract Filter ApplyStageExtract Filter ApplyStageStagePipelineMasterDBMSTransactionHistory LogIn-MemoryQueueSlaveDBMSExtract Filter ApplyExtract Filter ApplyExtract Filter ApplySunday, 5 May 13
  39. 39. ©Continuent 2012Multiple Services Per Replicator36NYCReplicatorLondonService nycFrankfurtReplicatorService fraReplicatorService nycService fraSunday, 5 May 13
  40. 40. ©Continuent 2012Disaster Recovery Sites37• Updates go to primary site master• DR site receives updates in real time• Simple command promotion• Tungsten connectors can route to primaryand DR sites• No application changes required• Simplest way to protect against region/sitefailuresSunday, 5 May 13
  41. 41. ©Continuent 2012Tungsten Composite Data Services38App Server+ ConnectorApp Server+ ConnectorMaster SlaveSan Jose New Yorksj_nycSunday, 5 May 13
  42. 42. ©Continuent 2012Switching and failover39• Planned switch/sj_nyc  >  switch  to  nyc• Failover/cluster  >  failover• Failover between sites is not automated!Sunday, 5 May 13
  43. 43. ©Continuent 2012Multi-Master Replication40• Updates on 2+ sites (active-active mode)• Enables geographic distribution of data• No failover necessary if network fails or sitebecomes unavailable• Not all applications can handle multi-master• Applications must avoid con!icts• Careful testing required• Restoration of broken systems may not be easySunday, 5 May 13
  44. 44. ©Continuent 2012Simple Multi-Master Con!guration41NYC FrankfurtReplicatorfra (master)nyc (slave)Replicatorfra (slave)nyc (master)Sunday, 5 May 13
  45. 45. ©Continuent 2012Complex Multi-Master Topologies42StarReplicationAllMastersSunday, 5 May 13
  46. 46. ©Continuent 2012Fan-In Replication43• Multiple masters feed into a single slave• Use case: Aggregate data for reporting• Consolidate data from multiple servers intoone server• Moving shards• Applications must avoid con#ictsSunday, 5 May 13
  47. 47. ©Continuent 2012Fan-In Topology44Sunday, 5 May 13
  48. 48. ©Continuent 2012 45Heterogeneous ReplicationSunday, 5 May 13
  49. 49. ©Continuent 2012Problem: Real-Time Order Ful!llment46Real-Time ReplicationMySQLWeb-Facing Sales Purchase OrderingOraclePHP/PerlJava/JBoss3MOrderItems1-2M transactions dailySunday, 5 May 13
  50. 50. ©Continuent 2012How Does Tungsten Do That?47MySQL Tungsten MasterReplicatorOracleService oracleMySQLExtractorSpecial Filters* Transform enum to stringbinlog_format=rowTungsten SlaveReplicatorService oracleSpecial Filters* Ignore extra tables* Map names to upper case* Optimize updates toremove unchanged columnsMySQLBinlogSunday, 5 May 13
  51. 51. ©Continuent 2012Batch Loading to Data Warehouses48CsvFileCsvFileCsvFile. . .LondonReplicatorService batchVerticaDataWarehouseTransactionHistory LogMySQLMasterTHLSunday, 5 May 13
  52. 52. ©Continuent 2012Possibilities for Analytics...49OLTP DataMySQL MasterComplex, nearreal-timereportingLight-weight,real-timeoperationalstatusWeb-facing mini-data marts forSaaS usersSunday, 5 May 13
  53. 53. ©Continuent 2012Getting Started50Sunday, 5 May 13
  54. 54. ©Continuent 2012How Much Does Tungsten Cost?51• Continuent Tungsten Annual Subscription• $7,000 per DBMS, $3500 for hot stand-by (DR)• 24x7, worldwide support• Product upgrades and fast patches• No per-core pricing• No extra Oracle licenses requiredVolume, site, and multi-year discounts applySunday, 5 May 13
  55. 55. ©Continuent 2012Consulting and ImplementationServices52• Delivered by clustering / replicationexperts• Wide range of consulting services• Software deployment/upgrade• Special projects• Feature development from small to very large• Standard daily rate: $2KDiscounts for large(r) engagementsSunday, 5 May 13
  56. 56. ©Continuent 2012How Do I Obtain Tungsten?53• Register at Continuent to get downloads for Oraclereplication:http://www.continuent.com/downloads/software• Documentation is available on Continuent website• MySQL replication is available from TungstenReplicator project on code.google.comhttp://code.google.com/p/tungsten-replicator/Sunday, 5 May 13
  57. 57. ©Continuent 2012.Continuent Web Page:http://www.continuent.comTungsten Replicator 2.0:http://code.google.com/p/tungsten-replicatorOur Blogs:http://scale-out-blog.blogspot.comhttp://datacharmer.org/bloghttp://www.continuent.com/news/blogs560 S. Winchester Blvd., Suite 500San Jose, CA 95128Tel +1 (866) 998-3642Fax +1 (408) 668-1009e-mail: sales@continuent.comSunday, 5 May 13
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×