• 1. Low Cost & High Performance MySQL Cloud DatabaseWei Cao Feng Yu Jiasen Xie
  • 2. AgendaIntroduction Architecture Data Routing Control System High Availability Resource Isolation Sharding Alibaba NightAlibaba Group
  • 3. IntroductionMulti-tenant database system on cloud Tens of thousands of customers Geographic distributed 6 regions across the country Dozens of IDCs More zones in the future Elastic Small - share a single instance Medium – distinct instances Huge - sharding across machinesAlibaba Group
  • 4. ArchitectureAlibaba Group
  • 5. Data RoutingProxy based layer-7 data routering MySQL protocol compatible Analyzing SQL and intercept SQL injections Track user sessions Keep user TCP connections alive while upgrading backends Support more database protocols in the future Implemented by Erlang Concurrent oriented programming language / Co-thread Fair scheduling to avoid starvation Isolation and fault tolerance between sessions Hot updateAlibaba Group
  • 6. Control SystemHandle various tasks Instance creation, migration, backup, restore etc. Task is dissembled into dozens to hundreds of steps Step context is serialized and can be suspended and retry later RPC based on RabbitMQ Messages need to be idempotent Zookeeper Cluster membership management Leader electionAlibaba Group
  • 7. High AvailabilityHot standby Standby is read only Proxy direct all writes to the master Switch between master and slave Failover, file system hang, upgrade etc. Multiple proxies switch writes to new master in a transactional manner (2PC) Improvements to MySQL replication Implicit primary key in any table Alibaba Group
  • 8. Resource IsolationProcess level isolation One process each database instance Hundreds of processes per machine Resources: CPU/mem/disk io/network Linux Use Cgroup Supported by Alibaba kernel team Windows Implemented in various driver layer IOPS - Windows Filesystem Filter layer Network - Windows NDIS Filter layerAlibaba Group
  • 9. ShardingUse case Cold data Move outdated data to cheap medium from time to time Hot data is huge Horizontal partition Build into proxy User transparencyAlibaba Group
  • 10. Alibaba NightRecently Alibaba’s China retail marketplaces generated GMV of US$5.8 billion dollars worth of sales in a single day. Learn what it takes to run these sites and how Alibaba Group has impacted the Chinese economy. This event is specifically geared towards researchers, engineers and IT professionals who are interested in learning about the growth of e-commerce and technology. Join us for this FREE event as we share learning’s and surge ahead in 2014!  Time:4th September Location: Alibaba Xixi Campus Agenda:
 - Tour of Xixi Campus - Presentations from Alibaba - Q&A SessionAlibaba Group