$30 off During Our Annual Pro Sale. View Details »

Building highly available and fault tolerant sites on a budget

Building highly available and fault tolerant sites on a budget

How to easily build systems that are fault-tolerant enough and available-enough so that you're not a slave to your servers' uptime.

Senko Rašić

October 04, 2015
Tweet

More Decks by Senko Rašić

Other Decks in Programming

Transcript

  1. Building highly available
    and fault tolerant
    sites on a budget
    Senko Rašić, Good Code

    View Slide

  2. View Slide

  3. View Slide

  4. If your server crashes
    I feel bad for you son
    I got 99% problems
    but the uptime ain’t one

    View Slide

  5. Delegate

    View Slide

  6. View Slide


  7. Ƭ

    View Slide


  8. Ƭ

    Ƭ

    View Slide

  9. DNS
    master.example.com A 192.168.1.100
    slave.example.com A 192.168.1.101
    www.example.com CNAME master.example.com TTL 300

    View Slide

  10. Reverse Proxy
    ǃ
    Ý
    Ý
    master
    slave
    haproxy
    nginx

    View Slide

  11. Round-robin DNS
    master.example.com A 192.168.1.100
    slave.example.com A 192.168.1.101
    www.example.com CNAME master.example.com TTL 300
    www.example.com CNAME slave.example.com TTL 300

    View Slide

  12. Load Balancing
    ǃ
    Ý
    Ý
    master
    slave
    haproxy
    nginx

    50%
    50%

    View Slide

  13. ǃ


    master
    slave
    Ƭ
    State

    View Slide

  14. image credit: http://myopia.podbean.com/

    View Slide

  15. Warm Standby + Streaming Replication
    Replication Manager - http://repmgr.org/

    View Slide

  16. Row-based replication with Global Transaction Identifiers (GTIDs)
    Automatic health monitoring & failover - mysqlfailover

    View Slide

  17. Replica sets - http://docs.mongodb.org/manual/replication/

    View Slide

  18. Master-slave replication (SLAVEOF) + Sentinel
    Redis Cluster

    View Slide

  19. Budget
    Digital
    Ocean
    Linode Heroku* Azure* GCP*
    S3*
    (assets)
    DNS 2 x $5/mo 2 x $10/mo $3/mo
    Reverse
    Proxy
    3 x $5/mo 3 x $10/mo $3/mo
    PaaS $16/mo $50/mo $36/mo

    View Slide

  20. Future considerations
    • Backup
    • Crash recovery
    • Logging
    • Datacenter-wide failures

    View Slide

  21. CLOSE
    ENOUGH

    View Slide