SlideShare a Scribd company logo
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
Microservices evolution on Conversations API
Oleksandr Malinovskyi

Technical Lead at Conversations API
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
What Twilio is?
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
Twilio products
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
Conversations API
A single API for scalable, multiparty

conversations across channels
https://www.twilio.com/conversations-api
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
Existing Conversations API situation
Load
Team size: 3 teams, 4-5 devs each
AVG: ~~ 4700 RPS
© 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
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
Organization scaling
Simpler and faster on-call onboarding process
© 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
© 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
© 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
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
Existing architecture
© 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
© 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
© 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
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
Domain entity based split
© 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
© 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
© 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
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
Result of the Phase 1
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
Drawbacks
Increased latency + potential decrease in reliability due to additional service call
© 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
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
© 2020 TWILIO INC. ALL RIGHTS RESERVED.
QA

More Related Content

PDF
Service Mesh: Two Big Words But Do You Need It?
PDF
CNCF On-Demand Webinar_ LitmusChaos Project Updates.pdf
PDF
The Future of Service Mesh
PDF
Next Generation DDoS Services – can we do this with NFV? - CF Chui
PDF
Trending: Convergence of networking and security in stores and branches
PPTX
Securing Kubernetes Clusters with NGINX Plus Ingress Controller & NAP
PPTX
VM Farms Thrive with Dedicated IP Storage Networks
PDF
Cotendo Cloudlet Datasheet
Service Mesh: Two Big Words But Do You Need It?
CNCF On-Demand Webinar_ LitmusChaos Project Updates.pdf
The Future of Service Mesh
Next Generation DDoS Services – can we do this with NFV? - CF Chui
Trending: Convergence of networking and security in stores and branches
Securing Kubernetes Clusters with NGINX Plus Ingress Controller & NAP
VM Farms Thrive with Dedicated IP Storage Networks
Cotendo Cloudlet Datasheet

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

PDF
Fujitsu Hybrid IT & Multi Cloud Services
PDF
Fujitsu Hybrid IT and Multicloud Service Startegy
PDF
Should That Be a Microservice ?
PPTX
F5 and HashiCorp Multi-Cloud
PPTX
Evolution of the Telco Services Plane, Greg Sikora, TADSummit 2018
PDF
Cisco Connect Toronto 2018 sd-wan - delivering intent-based networking to t...
PDF
cross cloud inter-operability with iPaaS and serverless for Telco cloud SDN/NFV
PDF
Infrastructure as Code in Large Scale Organizations
PPTX
2015 cloud trend and cloud DR
PDF
Transformation As A Service
PPTX
From Pivotal to VMware Tanzu: What you need to know
PDF
Data Plane Matters! A Deep Dive and Demo on NGINX Service Mesh
PPTX
Contino Webinar - Migrating your Trading Workloads to the Cloud
PDF
How to augment On-premise Call Centers to Scale-out to the Cloud
PDF
Presentation capturing the cloud opportunity
PDF
Cloud Whitepaper - Telco sp Cloud Market - Challenges
PPTX
Telecoms Service Assurance & Service Fulfillment with Neo4j Graph Database
PDF
Patrick Kerpan's CSA EMEA Congress presentation "Overlay Networks: Connecting...
PPTX
Introduction to Cloud B2B Integration
PDF
A New Approach to Continuous Monitoring in the Cloud
Fujitsu Hybrid IT & Multi Cloud Services
Fujitsu Hybrid IT and Multicloud Service Startegy
Should That Be a Microservice ?
F5 and HashiCorp Multi-Cloud
Evolution of the Telco Services Plane, Greg Sikora, TADSummit 2018
Cisco Connect Toronto 2018 sd-wan - delivering intent-based networking to t...
cross cloud inter-operability with iPaaS and serverless for Telco cloud SDN/NFV
Infrastructure as Code in Large Scale Organizations
2015 cloud trend and cloud DR
Transformation As A Service
From Pivotal to VMware Tanzu: What you need to know
Data Plane Matters! A Deep Dive and Demo on NGINX Service Mesh
Contino Webinar - Migrating your Trading Workloads to the Cloud
How to augment On-premise Call Centers to Scale-out to the Cloud
Presentation capturing the cloud opportunity
Cloud Whitepaper - Telco sp Cloud Market - Challenges
Telecoms Service Assurance & Service Fulfillment with Neo4j Graph Database
Patrick Kerpan's CSA EMEA Congress presentation "Overlay Networks: Connecting...
Introduction to Cloud B2B Integration
A New Approach to Continuous Monitoring in the Cloud
Ad

More from Fwdays (20)

PDF
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
PDF
"Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts"...
PPTX
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
PPTX
"Як ми переписали Сільпо на Angular", Євген Русаков
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
PDF
"Validation and Observability of AI Agents", Oleksandr Denisyuk
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
PPTX
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
PPTX
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
PDF
"AI is already here. What will happen to your team (and your role) tomorrow?"...
PPTX
"Is it worth investing in AI in 2025?", Alexander Sharko
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
PDF
"Scaling in space and time with Temporal", Andriy Lupa .pdf
PPTX
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
PPTX
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
PPTX
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
PPTX
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
"Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts"...
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
"Як ми переписали Сільпо на Angular", Євген Русаков
"AI Transformation: Directions and Challenges", Pavlo Shaternik
"Validation and Observability of AI Agents", Oleksandr Denisyuk
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
"AI is already here. What will happen to your team (and your role) tomorrow?"...
"Is it worth investing in AI in 2025?", Alexander Sharko
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Database isolation: how we deal with hundreds of direct connections to the d...
"Scaling in space and time with Temporal", Andriy Lupa .pdf
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...
Ad

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Machine Learning_overview_presentation.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Big Data Technologies - Introduction.pptx
A Presentation on Artificial Intelligence
Diabetes mellitus diagnosis method based random forest with bat algorithm
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Spectroscopy.pptx food analysis technology
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.
MIND Revenue Release Quarter 2 2025 Press Release
Machine learning based COVID-19 study performance prediction
Machine Learning_overview_presentation.pptx
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
Assigned Numbers - 2025 - Bluetooth® Document
Building Integrated photovoltaic BIPV_UPV.pdf
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Big Data Technologies - Introduction.pptx

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

  • 1. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Microservices evolution on Conversations API Oleksandr Malinovskyi
 Technical Lead at Conversations API
  • 2. © 2020 TWILIO INC. ALL RIGHTS RESERVED. What Twilio is?
  • 3. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Twilio products
  • 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. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Existing Conversations API situation Load Team size: 3 teams, 4-5 devs each AVG: ~~ 4700 RPS
  • 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. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Organization scaling Simpler and faster on-call onboarding process
  • 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. © 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. © 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. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Existing architecture
  • 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. © 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. © 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. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Domain entity based split
  • 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. © 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. © 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. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Result of the Phase 1
  • 20. © 2020 TWILIO INC. ALL RIGHTS RESERVED. Drawbacks Increased latency + potential decrease in reliability due to additional service call
  • 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. © 2020 TWILIO INC. ALL RIGHTS RESERVED. © 2020 TWILIO INC. ALL RIGHTS RESERVED. QA