Today we are thrilled to announce the initial OSS preview release of Envoy Mobile, an iOS and Android client network library that brings the power of Envoy Proxy to mobile platforms. This is the beginning of a journey that we hope mobile developers around the industry will join us on.

Background

When Lyft originally announced Envoy in 2016, the project goal was simply stated as:

The network should be transparent to applications. When network and application problems do occur, it should be easy to determine the source of the problem.

Envoy proxy was initially built at Lyft to solve the networking and observability issues inherent in large polyglot server-side microservice architectures. Over the last two and a half years, much to our surprise and satisfaction, Envoy has become incredibly popular throughout the industry. Today Envoy is used by all major public cloud providers, countless end user companies, and a plethora of infrastructure startups that have recognized Envoy’s extensibility as a useful base with which to build vertical applications and services. For those not familiar with Envoy’s architecture and feature set, please see the links in the further reading section at the bottom of this post.

As fundamental as Envoy has become in scaling both Lyft and other organizations’ distributed architectures, the reality is that three 9s at the server-side edge is meaningless if the user of a mobile application is only able to complete the desired product flows a fraction of the time. This may be due to a combination of network and application errors. Thus, in order to fully achieve the Envoy project’s goal of making the network transparent to applications, the service mesh and its inherent benefits (observability, consistency, etc.) must expand beyond the edge all the way to the mobile applications that are so critical to the end user’s experience. Envoy Mobile in conjunction with Envoy in the data center will provide the ability to reason about the entire distributed system network, not just the server-side portion.

Three 9s at the server-side edge is meaningless if the user of a mobile application is only able to complete the desired product flows a fraction of the time.

Envoy mobile goals

Whereas server-side Envoy proxy is a self-contained process that is meant to be deployed alongside a polyglot architecture, Envoy Mobile is distributed as a library meant to be compiled directly into client mobile applications. The library approach is required due to the practicalities of how applications are written and distributed on both the iOS and Android platforms. The high level goals of the library are discussed in the following subsections.

Consistent cross-platform advanced low level networking

Low-level networking improvements like HTTP/2, QUIC, QUIC to TCP failover, gRPC, DNS replacements, push/streaming, observability, analytics, state of the art TLS, retry and timeout policies, etc. take a tremendous amount of effort both to implement robustly as well as to make consistent across all of the Android and iOS versions in common use. Envoy Mobile will provide all of this functionality in a consistent cross-platform manner, especially when paired with Envoy running at the edge, similar to how server-side Envoy provides consistency to polyglot distributed application architectures.

Ubiquitous API and abstraction for networking

With the industry progressively moving towards specifying APIs via a strongly typed IDL such as protocol buffers, Envoy Mobile will standardize and abstract how mobile developers interact with IDL exposed endpoints. Via intelligent protobuf code generation and an abstract transport, both iOS and Android can provide similar interfaces and ergonomics for consuming APIs. Initially we are planning on focusing our efforts on Swift APIs for iOS and Kotlin APIs for Android, but depending on community interest we will consider adding support for additional languages in the future. Our ultimate goal is to make the low-level Envoy common C++ code an implementation detail that the average mobile developer does not need to be aware of. Instead, mobile developers will interact with high-level language specific APIs that encapsulate common concerns such as making API calls, analytics, tracing, etc.

Simple and explicit system for supporting advanced networking features

With protocol buffer’s powerful annotation/extension system, Envoy Mobile can add sophisticated cross-platform functionality in a simple and explicit way when using strongly typed IDL APIs. Examples of annotations that are planned on our roadmap include:

Marking an API as offline/deferred capable

Caching

Priority

Streaming

Marking fields for exclusion both on the request and response in poor network conditions

General Envoy policies such as retry and timeout specifications

Much like Envoy’s use in a server-side service mesh, the goal is to push as much functionality as possible into the common core so as to avoid reimplementing it in every mobile application language.

Our long-term plans include evolving the gRPC Server Reflection Protocol into a streaming reflection service API. This API will allow both Envoy and Envoy Mobile to fetch generic protobuf definitions from a central IDL service, which can then be used to implement annotation-driven networking via reflection. This model means that Envoy Mobile will not necessarily need to have prior knowledge of an organization’s APIs in order to provide enhanced cross-platform networking functionality.

xDS driven mobile client policy

One of the reasons that Envoy has become so popular as a platform is its rich configuration discovery APIs which are collectively known as xDS (more information can be found here and here). These APIs allow a distributed set of Envoys to be managed by an eventually consistent control plane. One of the long term goals of Envoy Mobile is to bring xDS configuration all the way to mobile clients, in the form of routing, authentication, failover, load balancing, and other policies driven by a global load balancing system. This will be an extremely powerful mechanism for bringing layer 7 / application networking concepts all the way to the mobile client. One day, it may even become possible to compile WASM code server-side, remotely distribute it to mobile clients, and remotely alter client behavior either to fix latent bugs or react more quickly to customer needs without needing to distribute a completely new client binary.

OSS strategy

This release is a proof of concept demo that shows Envoy compiled as a library and functional on both iOS and Android. Unlike when Lyft released Envoy in 2016, we are not providing a production-ready client networking solution. So why are we releasing it now?

Based on discussions with organizations around the industry, it seems clear that there is a strong desire for a comprehensive cross-platform client networking solution similar to what this project proposes. We have decided that it is in the industry’s best interest to release now, even while our team actively works on the base feature set required for shipping Envoy Mobile as the default networking transport layer in Lyft’s mobile applications. We look forward to collaborating with mobile engineering teams around the industry to ensure that what we build is generally useful, even while continuing to iterate at high velocity.

If we are successful in realizing our vision for the future of mobile client networking, we fully expect to grow the project’s maintainer ranks with engineers from around the industry, as well as ultimately migrate the project to a CNCF-owned vendor neutral location.

Join us and get started

In addition to the demo release which we encourage you to compile and play with, we are also open sourcing our roadmap and plan to develop Envoy Mobile entirely in the open. Please reach out to us via GitHub, email, or Slack if you would like to join us on our journey of defining the future of mobile client application networking. We look forward to hearing from you and collaborating with you!

Further reading

Este artículo también está en español: eng-espanol.lyft.com