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

A6cafa6da915d3b3f513e63f1ad2c127?s=128

Emil Stolarsky

September 30, 2016
Tweet

Transcript

  1. 3.

    3

  2. 6.

    6

  3. 7.

    7

  4. 13.

    13

  5. 14.

    14

  6. 15.

    15

  7. 16.

    16

  8. 17.

    17

  9. 18.

    18

  10. 29.
  11. 31.
  12. 34.

    34

  13. 38.

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

    by LB) 200: throttle page GET /checkout?poll=1 200: throttle page
  14. 39.

    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
  15. 40.

    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
  16. 42.

    42

  17. 46.

    46 PROCESS PID CONTROLLER SENSOR Controller Output Setpoint Process Variable

    Measured Process Variable Disturbances Feedback System
  18. 58.

    58

  19. 63.
  20. 66.

    66 Blank Slide Thanks! Fo llow m e o n

    Tw it te r @Em ilSt ol arsky