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

Microservices architecture and communication

Microservices architecture and communication

Omoloro Oyegoke spoke about Microservices architecture and communication on a forLoop Google Hangout conference.

forLoop

May 28, 2016
Tweet

More Decks by forLoop

Other Decks in Technology

Transcript

  1. The story so far... • There was a monolith •

    It was split into a client application and a web service • The web service was split into several smaller services around business units • Each service was then split into microservices based on individual processes
  2. The Monolith superdupermall.com.ng Homepage Search Category List Product Information Cart

    Checkout User Account CMS Inventory Management Order Management Customer Management Web Pages
  3. Client - Service superdupermall.com.ng Homepage Search Category List Product Information

    Cart Checkout User Account CMS Inventory Management Order Management Customer Management Web Pages
  4. Client - Service superdupermall.com.ng Homepage Search Category List Product Information

    Cart Checkout User Account CMS Inventory Management Order Management Customer Management Web Pages Mobile Client
  5. Client - Service superdupermall.com.ng Homepage Search Category List Product Information

    Cart Checkout User Account Web Pages Mobile Client api.superdupermall.com.ng
  6. What’s really going on • Homepage ◦ CMS ◦ Recommendations

    ◦ Featured products ◦ Deals • Detail pages ◦ Basic info e.g. name, description, images, price ◦ Reviews ◦ Recommendations • Listing pages ◦ Recommendations ◦ Filters ◦ Products
  7. What’s really going on • Account Pages / Customer Specific

    Information ◦ Order history ◦ Wishlist ◦ Cart ◦ Coupons • etc
  8. Decomposing our service Product Service Ratings Service Cart Service Stock

    Service Order Service Customer Service Wishlist Service
  9. Client - Service superdupermall.com.ng Homepage Search Category List Product Information

    Cart Checkout User Account Web Pages Mobile Client api.superdupermall.com.ng
  10. What does it mean for a mobile phone? • Each

    connection tries to negotiate a connection with a cell tower • Each packet has HTTP overhead increasing the size of data transferred • Mobile networks can be very unreliable and TCP will require lost packets to be resent… more data • Some responses may have more information than the client needs for that particular use case… even more data • Making that many requests isn’t friendly on the device’s battery life
  11. Gateways • Drastically reduces the number of requests • Allows

    efficient handling of retries, circuit-breakers, and fallbacks • Facilitates proper caching strategies
  12. User Service User service Request https://customers.superdupermall.com.ng/customers/123 Response { "user_id": "123",

    "first_name": "Omoloro", "last_name": "Oyegoke", "dob": "12-04-2001", "status": "active" }
  13. User Service User service Request https://customers.superdupermall.com.ng/customers/124 Response { "user_id": "124",

    "first_name": "Isaac", "last_name": "Asimov", "dob": "02-01-1920", "status": "inactive" }
  14. Bringing it all together Request https://api.superdupermall.com.ng/customers/123 Response { "user_id": "12",

    "first_name": "Omoloro", "last_name": "Oyegoke", "balance": 23500000 }
  15. Who’s doing it? • Netflix • Thoughtworks • Uber •

    Amazon • Sound Cloud • Konga http://microservices.io/articles/whoisusingmicroservices.html