Database Performance With Proxy Architectures

1,495 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,495
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Database Performance With Proxy Architectures

  1. 1. Database Performance with Proxy Architectures Tungsten SQL Router Robert Hodges CTO, Continuent, Inc. Percona Performance Is Everything 2009 © Continuent 2009
  2. 2. The “Proxy Math” Problem / Proxy layers solve a number of database problems • Seamless failover • Intelligent load balancing • Intelligent partitioning / Big Question: What’s the cost for applications? / Let’s 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. 3. Proxy Overhead Compared to Databases © Continuent 2009
  4. 4. Proxy with Increasing Result Sizes © Continuent 2009
  5. 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 • It’s 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. 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 • http://sourceforge.net/projects/tungsten / Built-in management • Manageable from network • Monitoring integration / Routing based on CAP theorem • Trade off consistency vs. availability vs. partition tolerance © Continuent 2009
  7. 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 Session Relaxed Consistency Consistency* Consistency Replication Slave Master Slave (latency) Slave *In progress © Continuent 2009
  8. 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.properties db2.properties db3.properties replicator/ / Configuration updated by administrative commands © Continuent 2009
  9. 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. 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. 11. Tungsten Drilldown – SQL-Router © Continuent 2009
  12. 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. 13. Contact Information HQ and Americas EMEA and APAC 560 S. Winchester Blvd., Suite 500 Lars Sonckin kaari 16 San Jose, CA 95128 02600 Espoo, Finland Tel (866) 998-3642 Tel +358 50 517 9059 Fax +358 9 863 0060 Fax (408) 668-1009 My e-mail: robert.hodges “at” continuent.com Commercial solutions: http://www.continuent.com Tungsten open source stack: http://community.continuent.com http://sourceforge.net/projects/tungsten © Continuent 2009

×