Successfully reported this slideshow.
Your SlideShare is downloading. ×

"Evolution of microservice architecture on Conversations API", Alexander Malinovsky

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 22 Ad

"Evolution of microservice architecture on Conversations API", Alexander Malinovsky

Download to read offline

I'm going to talk about the evolution of microservice architecture on Twilio product called Conversations API. We'll consider the main reasons and drivers for architecture changes approaches to how we split our services and even in some cases merged several services in one. As a result, we'll sum up what our new architecture will look like, how it solves initial targets, and how it can be used for the next features.

I'm going to talk about the evolution of microservice architecture on Twilio product called Conversations API. We'll consider the main reasons and drivers for architecture changes approaches to how we split our services and even in some cases merged several services in one. As a result, we'll sum up what our new architecture will look like, how it solves initial targets, and how it can be used for the next features.

Advertisement
Advertisement

More Related Content

Similar to "Evolution of microservice architecture on Conversations API", Alexander Malinovsky (20)

More from Fwdays (20)

Advertisement

Recently uploaded (20)

"Evolution of microservice architecture on Conversations API", Alexander Malinovsky

  1. 1. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Microservices evolution on Conversations API Oleksandr Malinovskyi
 Technical Lead at Conversations API
  2. 2. © 2020 TWILIO INC. ALL RIGHTS RESERVED. What Twilio is?
  3. 3. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Twilio products
  4. 4. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Conversations API A single API for scalable, multiparty
 conversations across channels https://www.twilio.com/conversations-api
  5. 5. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Existing Conversations API situation Load Team size: 3 teams, 4-5 devs each AVG: ~~ 4700 RPS
  6. 6. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Organization scaling More teams to fasten the development process ○ Ability to assign ownership of the feature to particular team, spreads cross team communication ○ Decreases load on single code base, less chances to step on each others toes
  7. 7. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Organization scaling Simpler and faster on-call onboarding process
  8. 8. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Organization scaling Team is better specialized on some domain which improves specialization and quality ○ Fewer things to own by single team
  9. 9. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Reliability improvements Get rid of single point of failure ○ Abusive traffic for one part of functionality doesn’t mean degradation of the whole app for customer ○ The same is applicable to potential incidents on the other Introduce better fallback mechanisms and retries ○ Smart retries for messaging functionality Have opportunity to replay events after the incident
  10. 10. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Scaling and rate limiting ● Scale up only parts which are overloaded ○ Increased load of push notifications orchestration might require scale up of the whole service which might be inefficient and affect other parts of functionality ● Rate limiting should be smart ○ Fairness queues for async functionality ○ RPS limits on various operations
  11. 11. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Existing architecture
  12. 12. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Prerequisites for microservice adoption 1. Split storages 2. Common procedures for new service creation(Paved path) 3. Cloud adoption(AWS Cloud) https://fwdays.com/event/architecture-fwdays-2021/review/migration-from-cassandra-to-dynamodb
  13. 13. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Communication mechanisms ● Synchronous ○ Simple to implement ○ No additional infra costs ○ Lack of retries if service is down ○ Tight coupling between services ● Event-driven ○ Additional service to maintain(message broker) ○ Loose coupling ○ Opportunity to replay events / restore the state
  14. 14. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Types of event driven architecture https://martinfowler.com/articles/201701-event-driven.html Point to take into account: max event size. For kafka by default it’s 1 MB! ● Event notification ● Event carried state transfer ● Event sourcing ● CQRS
  15. 15. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Domain entity based split
  16. 16. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Main issues with domain based split 1. Cross service requests 2. Potential inconsistencies due to lack of transactions 3. Potential issues with data replication 4. Difficult to set boundaries between the teams
  17. 17. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Functionality based split 1. Core data access 2. Push notifications 3. Webhooks 4. Billing 5. Outbound channel fanout 6. SDK protocols
  18. 18. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Services decommissioning VS 1. Shared data storage 2. Shared code base which requires updates in two places 3. Complexities in testing Data cleanup service in isolation
  19. 19. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Result of the Phase 1
  20. 20. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Drawbacks Increased latency + potential decrease in reliability due to additional service call
  21. 21. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Conclusions PROS 1. Introduced 1 more completely independent team + shared some features with 2 other teams 2. Better reliability for some of the features + additional rate limiting protection due to even driven nature 3. Due to independence of domains each service can scale independently and based it’s own needs CONS 1. Time for feature development not decreased(yet?) 2. Latencies increased in some cases
  22. 22. © 2020 TWILIO INC. ALL RIGHTS RESERVED. © 2020 TWILIO INC. ALL RIGHTS RESERVED. QA

×