Scalable webapps

We won't talk about

  • Clean Code
  • Language of choice
  • Colour of your IDE..
  • Absolute truths
  • Complex code

We'll talk about

  • My personal experiences
  • How systems where scale >= 1 can fail spectacularly
  • How you'll fail spectacularly
  • Actually useful stuff :)

Scalable?

  • No local state
  • distributed (if needed)
  • decoupled components
  • Service discovery
  • Fail gracefully (No 500 pages pls)

Session?

  • Yes please!
  • Store on local disk! (it works in the beginning)
  • Hm... Let's scale up!
  • DAFUQ??
  • Common session store for all instances!
  • Profit!

Static assets

  • simply write the uploaded file to disk
  • Ok, but what if we are flickr?
  • Buy more disks (No)
  • Run multiple instances of the same service
  • 404????
  • Shared storage!
  • Buy more disks for your shared storage :)

Long running operations?

  • It'll be less than http request timeout
  • ....
  • maybe
  • what if not?
  • * Empty reply from server
    * Connection #0 to host localhost left intact
    curl: (52) Empty reply from server
     :(((
  • Use queues 
  • Poll for the result!
  • If we fail we can still retry 
  • Micro services are cool anyway

Loadbalancer what?

  • Actual examples
  • Algorithms (RR, WRR, WTF) 
  • Loadbalancers in the wild

deck

By Bálint Csergő