From Flying Circus to Holy Grail: Migrating the Twilio API from PHP to Python
summary
Twilio’s REST API migrates from a 500k‑line PHP monolith to a fleet of Python services behind a starship proxy (Flask + Flask‑RESTful + requests) that maps public routes to internal REST services. Starship implements auth, validation, rate limits, instrumentation (Datadog), and async I/O with gevent, and handles ~5,000 req/s. Migration proceeds endpoint‑by‑endpoint using nginx routing, the proxied resource pattern, unit/integration/cluster tests, response diffing, shadowing and canary rollouts to validate behavior without downtime.
AI-written summary · about
chapters (29)
- 0:00Start
- 4:34Difficult deploys
- 5:09Hard to understand
- 5:36Operationally awful
- 6:49What to do?
- 7:08Refactor and replace!
- 8:50Starship: API Federation (The Next Generation)
- 10:32Proxied Resource
- 11:43Benefits
- 12:21Flexibility
- 12:49Operational excellence
- 15:10Planning
- 15:56Start small
- 16:41Architecture
- 17:09We can solve any problem by introducing a layer of indirection
- 18:18Keep it simple
- 18:43Testing
- 19:30Test in layers
- 21:31Starship's Test Pyramid Unit tests: auth functions, transformations, serializations, etc. • Integration tests: mocked-out requests • Cluster tests: black box requests to live systems • Manual tests
- 22:15Starship's Test Pyramid Unit tests: auth functions, transformations, serializations, etc. • Integration tests: mocked-out requests Cluster tests: black box requests to live systems • Manual tests
- 22:39Reduce overhead: find common cases
- 24:35Throwaway tests
- 25:02Response diffing
- 26:46Small Fast Simple
- 27:31Shadow deployments
- 28:56Canaries
- 29:26Batch
- 30:09Cheat
- 38:02NEXT DAY VIDEO
related talks
21mThe great SOA migration
27mHow We Migrated 3.8 Million Lines of Python 2 Without Interrupting Deve...
39mA scalable blueprint for product customization with Python 3
36mA Python Takeover
36mA Python Takeover
44mPython in the MicroServices world
31mFighting the Good Fight: Python 3 in your organization
30mHow To Build a Python Microservice Without Losing a Job
