Lyft Michael Rebello Jan 21, 2020

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

Critical Insight

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.

The article hints at upcoming open source releases of their mobile code generators and deeper dives into streaming, push notifications, and Envoy Mobile's evolution.

About This Article

Problem

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.

Solution

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.

Impact

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.