logo

Context Aware Traffic Routing for Stateful Services using Envoy

2021-10-15

Authors:   Renana Yacobi, Piaw Na


Summary

The presentation discusses context aware traffic routing for stateful services using Envoy, which involves using information extracted from the message payload to route traffic while supporting legacy APIs.
  • Context aware routing involves using the content of the request message to route traffic
  • The proposed solution involves putting the client to server mapping closer to the message routing process
  • A state coordinator service is added to synchronize the client to server mapping across all Envoys
  • The solution guarantees 100% correctness
  • The solution improves performance and handles larger messages more efficiently
The presentation mentions an example of retrofitted smart routing based on data already being passed into the packet, without changing the application. The solution involved breaking up a monolithic application into microservices and routing individual protocol sub-messages to different services simultaneously.

Abstract

Service infrastructure should be invisible to application APIs but frequently the implementation leaks into the APIs, injected in the form of URL prefixes or message headers custom fields. In some cases this is undesirable due to the sensitivity of the information. Examples of such cases include PII and company IP. In these scenarios a message is sent to the server, which makes a routing decision based on the information inside the message. At that point a reroute request is send to the client that redirect its calls to the assigned backend, In this presentation, Renana Yacobi, Server Core Infrastructure Lead @ Niantic, presents a context aware routing, using the power of Envoy custom filters and partial message parsing to use information extracted from the message payload to route the traffic while supporting legacy APIs.

Materials: