Scaling Django with Distributed Systems

Scaling Django with Distributed Systems

A talk I gave at PyCon Ukraine 2017.

077e9a0cb34fa3eba2699240c9509717?s=128

Andrew Godwin

April 07, 2017
Tweet

Transcript

  1. 1.
  2. 2.
  3. 13.
  4. 27.

    If a request writes to a table it must be

    pinned there, so later reads do not get old data
  5. 30.
  6. 31.

    Both Users 0 - 2 Users 3 - 5 Users

    6 - 8 Users 9 - A Events 0 - 2 Events 3 - 5 Events 6 - 8 Events 9 - A Tickets 0 - 2 Tickets 3 - 5 Tickets 6 - 8 Tickets 9 - A
  7. 32.

    Both plus caching Users 0 - 2 Users 3 -

    5 Users 6 - 8 Users 9 - A Events 0 - 2 Events 3 - 5 Events 6 - 8 Events 9 - A Tickets 0 - 2 Tickets 3 - 5 Tickets 6 - 8 Tickets 9 - A User Cache Event Cache Ticket Cache
  8. 35.

    Users 0 - 2 Users 3 - 5 Users 6

    - 8 Users 9 - A Events 0 - 2 Events 3 - 5 Events 6 - 8 Events 9 - A Tickets 0 - 2 Tickets 3 - 5 Tickets 6 - 8 Tickets 9 - A User Cache Event Cache Ticket Cache User Service Event Service Ticket Service
  9. 41.
  10. 43.

    A single point of failure is not always bad -

    if the alternative is multiple, fragile ones
  11. 47.

    Failure Mode At most once Messages either do not arrive,

    or arrive once. At least once Messages arrive once, or arrive multiple times
  12. 48.

    Guarantees vs. Latency Low latency Messages arrive very quickly but

    go missing more Low loss rate Messages are almost never lost but arrive slower
  13. 49.

    Queuing Type First In First Out Consistent performance for all

    users First In Last Out Hides backlogs but makes them worse