database performance with proxy architectures

Download Database  Performance With  Proxy  Architectures

Post on 16-Jun-2015




4 download

Embed Size (px)


  • 1. Database Performance with Proxy ArchitecturesTungsten SQL RouterRobert Hodges CTO, Continuent, Inc.Percona Performance Is Everything 2009 Continuent 2009

2. The Proxy Math Problem/ Proxy layers solve a number of database problems Seamless failover Intelligent load balancing Intelligent partitioning / Big Question: Whats the cost for applications? / Lets run a few tests to show basic limits Simple queries with data guaranteed to be in buffer cache Dell SC 1425, Xeon 2 CPU x 2 Cores, 2.8Mhz No/minimal proxy logic Continuent 2009 3. Proxy Overhead Compared to Databases Continuent 2009 4. Proxy with Increasing Result Sizes Continuent 2009 5. How Do We Avoid Proxy Math?/ Proxy performance is CPU intensive Mostly copying and transforming bytes / Bad case: 4x CPU resources for same throughput Could be far worse if proxy does more than copy data Its not enough to make proxies faster / Alternative 1: Hardware load balancer If I only had a brain / Alternative 2: VIPs Handy for availability but load balancing is a problem / Alternative 3: An embeddable library This would work on Amazon as well! Continuent 2009 6. Tungsten SQL Router Overview/ Library-based intelligent failover and load balancing / Connection-level routing / Implemented as JDBC library wrapper (Java!) Adds intelligence to vendor drivers / DBMS-independent and non-partisan / 100% open source / Built-in management Manageable from network Monitoring integration / Routing based on CAP theorem Trade off consistency vs. availability vs. partition tolerance Continuent 2009 7. CAP-Based Routing--Quality of Service Connection for Writes Connection for Reads jdbc:t-router://mysvc/db1 jdbc:t-router://mysvc/db1 ?qos=RW_STRICT?qos=RO_RELAXED(Data Service)Strict SessionRelaxed Consistency Consistency*ConsistencyReplication SlaveMasterSlave (latency)Slave*In progress Continuent 2009 8. Services and Data Sources / SQL Router connects to services, not hosts / Services are composed of data sources / Configuration stored in CLUSTER_HOME directory$CLUSTER_HOME/ services/ mysvc/datasource/db1.propertiesdb2.propertiesdb3.propertiesreplicator/ / Configuration updated by administrative commands Continuent 2009 9. Administration and Monitoring/ SQL Router library has JMX ports for administration / Update status of data sources using rmctl program:sql-router[mysvc:ONLINE]> db2 offline SENT NOTIFICATION: DATASTORE db2 offline sql-router[mysvc:ONLINE]> db1 online SENT NOTIFICATION: DATASTORE db1 online sql-router[mysvc:ONLINE]> db3 online SENT NOTIFICATION: DATASTORE db3 online / Listeners for monitoring events Use UDP or group communications or Automatically take data sources online/offline Continuent 2009 10. Does It Work with Non-Java Programs?/ Yes / Use Tungsten Connector as front end / Full circle back to better SQL proxies Continuent 2009 11. Tungsten Drilldown SQL-Router Continuent 2009 12. Roadmap/ Upgraded monitoring Create/remove data sources automatically from monitoring data Specify maximum permitted latency / Session consistency / Partitioning / Sharding Route databases to different servers Continuent 2009 13. Contact InformationHQ and Americas EMEA and APAC560 S. Winchester Blvd., Suite 500Lars Sonckin kaari 16San Jose, CA 9512802600 Espoo, FinlandTel (866) 998-3642Tel +358 50 517 9059Fax +358 9 863 0060Fax (408) 668-1009 My e-mail: robert.hodges at continuent.comCommercial solutions: http://www.continuent.comTungsten open source stack: Continuent 2009


View more >