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

Architecture with NoSQL: Experiences of a SaaS startup

lautis
August 21, 2012

Architecture with NoSQL: Experiences of a SaaS startup

Presentation at WICSA 2012 Industry day.

lautis

August 21, 2012
Tweet

More Decks by lautis

Other Decks in Technology

Transcript

  1. Architecture with
    NoSQL
    Experiences of a SaaS startup
    Ville Lautanala

    View Slide

  2. View Slide

  3. •Single page JavaScript front-end
    •Thousands of concurrent users
    •Three replicated databases
    •X servers on two continents
    •99.98% availability
    Facts

    View Slide

  4. Streaming
    API
    MongoDB
    Redis
    + IRC, Twitter, RSS, and Email
    integrations
    WebSocket
    API
    Message Backend
    PostgreSQL
    Rails App

    View Slide

  5. MongoDB
    • Document-oriented
    • JSON based queries
    • Scalable reads and
    writes
    • Replication and
    failover built-in
    • No transactions, no
    JOINs

    View Slide

  6. SSD == Awesome

    View Slide

  7. View Slide

  8. Chef

    View Slide

  9. Manage servers
    with code
    1. Edit recipes
    2. knife upload
    3. ???
    4. Profit!!!

    View Slide

  10. Redis: in-memory DB
    •Key-value store
    •Data-structure server
    •Network accessible shared memory
    •Non-blocking event-bus (pub/sub)

    View Slide

  11. Flowdock message
    processing
    Redis Queue
    Redis
    Pubsub
    MongoDB
    Flowdock Backend

    View Slide

  12. Redis is SPoF

    View Slide

  13. ZooKeeper

    View Slide

  14. ZooKeeper?
    •Highly-available key-value store
    •Enables distributed coordination
    •Listen for value changes
    •Eventual consistency with quorum
    semantics

    View Slide

  15. Node Manager
    Node Manager
    Redis Node
    Redis Node
    ZooKeeper
    Monitor
    Update
    Redis Failover

    View Slide

  16. Zoos are kept.

    View Slide

  17. Chef ZooKeeper
    Configuration files
    Dynamic configuration
    variables
    Server installation Failover handling
    Chef vs ZooKeeper

    View Slide

  18. Network fail
    Flowdock
    Comcast
    Problems

    View Slide

  19. Taking control of
    the routes
    1. Submarine communications cable
    2. 3rd party CDN/Load Balancers
    3. AWS as SSL endpoint

    View Slide

  20. This Is How We
    Roll
    •GeoDNS chooses endpoint
    •Encrypted VPN mesh between
    servers
    •Servers near client act as SSL
    endpoint
    •Request processed near data

    View Slide

  21. 150ms faster page
    requests from U.S.

    View Slide

  22. Conclusions
    •MongoDB a bit like MySQL 15 years
    ago
    •Some NoSQL databases are
    suitable for distributed setups
    •Hardware and network issues
    needs to be addressed

    View Slide

  23. Thanks!

    View Slide