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

Nodepb - Breaking Down the Monolith

Nodepb - Breaking Down the Monolith

How we broke down our monolith and what we learned from it.

http://www.meetup.com/nodebp/events/229220584/

Peter Marton

March 30, 2016
Tweet

More Decks by Peter Marton

Other Decks in Programming

Transcript

  1. whoami - work: CTO, Co-founder of RisingStack, Inc. - twitter:

    slashdotpeter - email: [email protected] - blog: https://blog.risingstack.com
  2. Agenda - Monolith and Microservices - Advantages of Microservices -

    Disadvantages of Microservices - How we did
  3. Microservice - Smaller services with separate DB - Split code

    by feature not by functionality - Feature teams (cross-functional) - More focused teams with distributed responsibility - Not for MVP! https://microserviceweekly.com/
  4. What is ? - Our product (RisingStack) - Microservice monitoring

    tool - With distributed stack traces - Built with Node.js - Built as a monolith in MVP phase
  5. Microservices at RisingStack - Growing engineering team - Fault tolerance

    - Well focused service teams - Easier to scale - Well separated features
  6. That’s why we are leaving PaaS - AWS Elastic Beanstalk

    - VPC -> internal routing - Docker - Etcd with confd - $$$ efficient?
  7. Proxy - Route requests to services - Authorize requests via

    access-service - Decorate flippers (feature flag) - Rewrite urls - Evolutionary design - Everything is stateless REST between services
  8. Request signing - Trusted sources (services) on public channel -

    https://github.com/joyent/node-http-signature - Built-in in request and super-request npm modules POST /foo HTTP/1.1 Host: example.org Date: Tue, 07 Jun 2014 20:51:35 GMT Content-Type: application/json Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Content-Length: 18
  9. Service principles - max 3 depth call chains - always

    backward compatible endpoints - Do not version services, only endpoints - use flippers heavily - https://github.com/Yelp/service-principles - In progress...
  10. Documented API - Enforce documentation - Create service mocks from

    docs - Auto update docs from GitHub repository - Make it available for everyone