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

Microservice Architecture at Meducation

Avatar for malcyL malcyL
October 09, 2014
36

Microservice Architecture at Meducation

Avatar for malcyL

malcyL

October 09, 2014

Transcript

  1. Problems • Dependency Hell • Tight Coupling • Messy •

    Complex • Hard to Understand • Hard to Maintain • Buggy
  2. How did we scale? • Pub/Sub • Micro Service Architecture

    – “independently deployable services”
  3. Publisher SNS Topic SQS Queue Subscriber SQS Queue Subscriber SQS

    Queue Subscriber /user /user/email_service /user/badge_service /user/dashboard_service Pub/Sub Using SQS/SNS
  4. Glue when Subscribing SNS Topic SQS Queue Subscriber /user /user/email_service

    Propono.listen_to_queue(“user”) do |msg| #process message... end
  5. Problem: Visibility of Failure • Monitoring of Website • How

    do you know when daemons fail? • How do you recover after a failure?
  6. AWS SQS FAQ “SQS is engineered to provide “at least

    once” delivery of all messages in its queues. Although most of the time each message will be delivered to your application exactly once, you should design your system so that processing a message more than once does not create any errors or inconsistencies.”
  7. Don't Send Same Email Twice! Mailchimps API Daemon 1 Email

    Service user_topic AWS Simple DB key: /user/new_user/30660
  8. Larva http://github.com/meducation/larva “Larva is a Ruby daemon builder based on

    top of the Propono pub/sub library and the Filum logging library. It is the foundation for daemons in Meducation's infrastructure.”
  9. Larva • Standardise how daemons worked • Create new daemons

    very quickly – From scratch to live in less than a day
  10. What did we achieve? • Separation of Concern • Loose

    Coupling • Scalability • Add/Remove Functionality Quickly • Speed of Iteration
  11. Image Attribution • “Monorail Monday” by Joe Penniston – https://www.flickr.com/photos/expressmonorail/5548294525/

    • “Glue Goo” by Sam Catch – https://www.flickr.com/photos/samcatchesides/3326878608