September 19–20, 2016: Training
September 20–22, 2016: Tutorials & Conference
New York, NY

Scaling Shopify's multitenant architecture across multiple data centers

Florian Weingarten (Shopify)
1:30pm–2:10pm Wednesday, 09/21/2016
DevOps Networking, Resilience engineering Regent Audience level: Intermediate
Average rating: ****.
(4.33, 6 ratings)

Prerequisite knowledge

  • Experience hosting a medium- to large-scale web application
  • A basic understanding of TCP/IP networking
  • What you'll learn

  • Learn some network-level tricks about how to reduce downtime and increase availability
  • Gain insight into how to do failure isolation and proper "capacity isolation"
  • Understand the importance of scripted and automated disaster recovery
  • Description

    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.

    Photo of Florian Weingarten

    Florian Weingarten


    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.