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

Learning to Build Distributed Systems the Hard Way

Learning to Build Distributed Systems the Hard Way

Presentation held at JDays 4 December, 2012

Theo Hultberg

December 04, 2012
Tweet

More Decks by Theo Hultberg

Other Decks in Programming

Transcript

  1. ONE VISIT CAN CHANGE UP TO 100K COUNTERS hundreds of

    millions of individual counters per day, plus counting uniques and visitor histories
  2. START WITH TWO OF EVERYTHING going from one to two

    is the hardest, solve the scaling problem up front
  3. GIVE A LOT OF THOUGHT TO KEYS AND IDS and

    think about your queries first
  4. PRECOMPUTE ALL THE THINGS your users most likely don’t know

    what they want, so why let them do ad hoc queries?
  5. PLAN HOW TO GET RID OF YOUR DATA deleting stuff

    is harder than you might think × × × × × × ×
  6. CONSISTENT when there are interdependencies you need to route using

    some property of the objects, but make sure you get a uniform distribution
  7. 12

  8. A DIVERSION ABOUT COUNTING TO 60 the reason why there’s

    60 seconds to a minute, and 360 degrees to a circle × ×
  9. log2(366) ≈ 31 six characters 0-9, A-Z can represent 31

    bits, which is kind of almost very close to four bytes
  10. YOU CAN’T SCALE TO REAL TIME and don’t trust code

    that doesn’t run continuously ×
  11. DO YOU REALLY NEED A BACKUP? if you got 3x

    replication over multiple availability zones, is that backup really worth it?
  12. PRODUCTION IS THE ONLY REAL TEST ENVIRONMENT when thousands of

    things happen every second, new, weird and unforeseen things happen all the time, your tests can only cover the foreseeable =