Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Flash Sale Engineering

Flash Sale Engineering

From stores with ads in the Super Bowl to selling Kanye’s latest album, Shopify has built a name for itself handling some of the world’s largest flash sales. These high profile events generate write-heavy traffic that can be four times our platform’s baseline throughput and don’t lend themselves to off-the-shelf solutions.

This talk is the story of how we engineered our platform to survive large bursts of traffic. Since it’s not financially sound for Shopify to have the required capacity always running, we built queueing and page caching layers into our Nginx load balancers with Lua. To guarantee these solutions worked, we tested them with a purpose-built load testing service.

Although flash sales are unique to commerce platforms, the lessons we learn from them are applicable to any services that experience bursts of traffic.

Online version: https://youtu.be/-I4tIudkArY

Emil Stolarsky

September 30, 2016
Tweet

More Decks by Emil Stolarsky

Other Decks in Programming

Transcript

  1. 3

  2. 6

  3. 7

  4. 13

  5. 14

  6. 15

  7. 16

  8. 17

  9. 18

  10. 34

  11. 38 LB RAILS USER GET /checkout GET /throttle_page 200: (cached

    by LB) 200: throttle page GET /checkout?poll=1 200: throttle page
  12. 39 LB RAILS USER GET /checkout GET /throttle_page 200: (cached

    by LB) 200: throttle page GET /checkout?poll=1 200: throttle page GET /checkout?poll=1 GET /checkout?poll=1
  13. 40 LB RAILS USER GET /checkout GET /throttle_page 200: (cached

    by LB) 200: throttle page GET /checkout?poll=1 200: throttle page 302: set checkout pass GET /checkout?poll=1 GET /checkout?poll=1 302: /checkout
  14. 42

  15. 46 PROCESS PID CONTROLLER SENSOR Controller Output Setpoint Process Variable

    Measured Process Variable Disturbances Feedback System
  16. 58

  17. 66 Blank Slide Thanks! Fo llow m e o n

    Tw it te r @Em ilSt ol arsky