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

Simply Distributed

Simply Distributed

Nugroho Herucahyono

October 22, 2015
Tweet

More Decks by Nugroho Herucahyono

Other Decks in Technology

Transcript

  1. More business value Need more reliable System should be fault

    tolerant Self healing Backup, redundancy
  2. How we do it? Current “Best practice”: • Split system

    into smaller services • Communicate with http • Scale independently • Gracefully handle failure
  3. How we do it? Load Balancer Search Engine Client Authentication

    Content Management Search Scheduler Transaction Database 2 Database 1 Job Queue
  4. How we do it? Current “Best practice” apparently is not

    the best: • Requires massive change to our system • Manual load balancing, replication • Manual resource management • Inefficient communication (http? really?)
  5. How we do it? Load Balancer Search Engine Client Authentication

    Content Management Search Scheduler Transaction Database 2 Database 1 Job Queue Too Complicated!!
  6. A new layer of abstraction • Handle resource management •

    Handle load balancing • Handle service communication • Handle service failure • Handle replication
  7. A new layer of abstraction Cluster Operating system Operating System

    Pod Application Hardware Operating System Pod Application Hardware Operating System Pod Application Hardware
  8. Cluster Operating System • Build in interprocess communication • Build

    in monitoring & supervision • Automatic load balancing • Automatic resource management • Scale with little / no system modification
  9. Erlang VM & OTP node 1 erlang vm erlang processes

    node 2 erlang vm erlang processes
  10. Erlang VM & OTP • Build in interprocess communication √

    • Build in monitoring & supervision √ • Automatic load balancing X • Automatic resource management X • Scale with little / no system modification √
  11. Erlang VM & OTP • The building block is too

    low level? (erlang processes) • Your application need to be written in erlang (or other erlang vm languages)
  12. Docker • Like virtual machine, but much lighter • Encapsulate

    our application into single “executable” • Remove dependencies, development vs production headache
  13. Kubernetes Host OS Docker Container Container Pod Host OS Docker

    Container Container Pod Node 1 Node 2 Kubernetes
  14. Docker & Kubernetes • Build in interprocess communication X •

    Build in monitoring & supervision √ • Automatic load balancing √ • Automatic resource management √ • Scale with little / no system modification X
  15. Docker & Kubernetes • No build in interprocess communication •

    Still have to modify the system (split into smaller services) • Too complicated
  16. Let’s zoom out a bit • Service vs Process •

    Node vs Core They’re conceptually the same
  17. Distributed Operating System • Encapsulate multiple machines as a single

    node • Transparent from user / application point of view • Handle load balancing, replication & distribution automatically • Better yet, if we can add more machine on the fly
  18. We’ve done something similar • Raid • Multiple disk, single

    volume • Transparent from applications • Automatic failure handling & replication
  19. Distributed Motherboard • Node 1, 32 Cores, 32 GB RAM

    • Node 2, 32 Cores, 32 GB RAM • Detected by operating system as 1 Node, 64 Cores, 64 GB RAM
  20. Distributed Motherboard • We can add more node, on the

    fly • Motherboard will communicate between each other • Abstract their resources as a SINGLE NODE
  21. We’ve done that too • Hardware Raid Controller • Multiple

    Disk, detected as a single hardware • Transparent from operating system & application
  22. Why does it matter? Scalable & Reliable system is a

    SOLVED problem We already have Google, Facebook, etc as a prove
  23. Why does it matter? • Scalable & Reliable system is

    not easy & cheap • Need a group of highly skilled experts to build
  24. Case Study: WhatsApp • WhatsApp use Erlang VM & OTP

    • They can scale it without adding too much complexity