Multitenant architectures are a very convenient and economical way to share resources like web servers, job workers, and datastores among several customers on your platform. Even the smallest Shopify store on a $9/month plan can easily survive getting hammered with a 1M RPM flash sale by leveraging the resources of the entire platform. However, architectures like this also have several drawbacks. They are potentially harder to scale, and things like resource starvation or backend outages are harder to isolate.
Florian Weingarten gives a brief history of how Shopify evolved from a single-database, single-data-center application to a multidatabase, multi-data-center setup and discusses the advantages in terms of resiliency, scalability, and disaster recovery that this architecture offers, how Shopify got there, and where it wants to go in the future. Florian outlines how to use the Border Gateway Protocol and equal-cost multipath routing for implementing intra–data-center high availability, how Shopify implements its own load-balancing algorithms, what it takes to prepare a Ruby on Rails application for a move like this, and how Shopify performs fully scripted data-center failovers in a matter of seconds with no considerable downtime.
Florian Weingarten is an infrastructure engineer on the Site Reliability Engineering team at Shopify in Ottawa, Canada, poking holes into other people’s code. In a previous life, he did research on cryptography. Originally from Germany, Florian studied mathematics and computer science at RWTH-Aachen University.
©2016, O'Reilly Media, Inc. • (800) 889-8969 or (707) 827-7019 • Monday-Friday 7:30am-5pm PT • All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. • email@example.com