Lyft's Journey Through Mobile Networking
Article Summary
Michael Rebello from Lyft reveals how they scaled from hand-written APIs to a unified networking architecture serving 500+ endpoints. The journey involved killing technical debt, slashing payload sizes by 50%, and bringing server-side proxy tech to mobile.
As Lyft's mobile team grew 15x in 5 years, their networking infrastructure had to evolve dramatically. This post chronicles their progression from inconsistent hand-coded APIs through YAML generation to a protocol buffers-based IDL system, and ultimately to integrating Envoy Mobile as part of their service mesh.
Key Takeaways
- Protocol buffers became single source of truth, generating consistent APIs across iOS, Android, and server
- Content negotiation with protobuf binary format cut response sizes by over 50% on large endpoints
- Custom code generators created Rx-based interfaces that abstracted transport layer implementation details
- Envoy Mobile integration treats mobile clients as mesh nodes, enabling shared functionality with backend services
- IDL abstraction allowed transport improvements without any product code changes
Lyft transformed mobile networking from error-prone manual implementations to an automated, protocol buffers-based system that improved performance while making mobile clients first-class citizens in their service mesh.
About This Article
Lyft had over 500 API endpoints spread across iOS, Android, and their servers. This created real problems: typos in JSON mappings, disagreements about which fields were optional, and different platforms handling HTTP status codes in their own ways. There was no shared contract to keep things consistent.
Michael Rebello's team switched to protocol buffers as their Interface Definition Language. They built custom code generators for Swift and Kotlin that could add metadata annotations. This let them gradually adopt protocol buffers while keeping their existing RESTful JSON APIs working, and they got type-safe, testable interfaces out of it.
By using content negotiation, they could roll out the protobuf binary format gradually. Large endpoints saw response payloads shrink by over 50%. Success rates improved too. The best part was that product code didn't need any changes because the IDL abstraction layer handled everything.