How does Shopify routes Traffic?

Simplify Complexity
1 min readMay 8, 2022

A short read —

What is the Problem?

  • The traffic could be ingress from multiple sources.
  • Edge could support a few types of applications only.
  • It was hard to onboard a new service to the edge.
  • Observability of overall traffic was missing or incomplete.

What’s an Edge?

The edge is a boundary between external traffic and internal cluster

Design Summary

The design uses separation of concerns in three buckets:

  1. Edge Load balancers with L7 routing
  2. A dispatcher for URL to application backend service
  3. Application backend

Edge Load balancers with L7 routing

The Edge Load Balance (Mobius) has common knowledge of valid URLs and forwarding routes. The Kubernetes API connects component is a shared knowledge of routes between SFE and Mobius.

A dispatcher for URL to application backend service

Shopify Front End. It is a set of nginx servers paired with Lua scripts to program routes for a URL.

What does the design bring?

  • The edge network is standard and unified. It is easy to host a new service from the edge.
  • Edge can quickly handle DDoS traffic. Any request arriving at any edge is safely validated and forwarded to a least-latency cluster’s SFE.
Simplify Complexity

Golang, Distributed Systems, File Systems, Python, C/C++, Linux