# How Shopify Dynamically Routes Storefront Traffic

DevFeed: [How Shopify Dynamically Routes Storefront Traffic](<https://devfeed.tech/articles/how-shopify-dynamically-routes-storefront-traffic-1377.md>)

Original publisher: [Read original article](<https://shopify.engineering/dynamically-route-storefront-traffic>)

Author: Derek Stride

Published: 2021-04-09T20:19:44Z

Content type: article

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [Shopify](<https://devfeed.tech/topics/shopify.md>), [nginx](<https://devfeed.tech/topics/nginx.md>), [Lua](<https://devfeed.tech/topics/lua.md>), [Server-side rendering](<https://devfeed.tech/topics/server-side-rendering.md>), [JSON](<https://devfeed.tech/topics/json.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [Caching](<https://devfeed.tech/topics/caching.md>)

Tags: [caching](<https://devfeed.tech/tags/caching.md>), [code-review](<https://devfeed.tech/tags/code-review.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [json](<https://devfeed.tech/tags/json.md>), [load-balancer](<https://devfeed.tech/tags/load-balancer.md>), [lua](<https://devfeed.tech/tags/lua.md>), [nginx](<https://devfeed.tech/tags/nginx.md>), [routing](<https://devfeed.tech/tags/routing.md>), [server-side-rendering](<https://devfeed.tech/tags/server-side-rendering.md>), [shopify](<https://devfeed.tech/tags/shopify.md>)

## AI overview

Shopify describes how its Storefront Renderer team dynamically routes traffic between legacy and new storefronts using nginx with OpenResty, Lua-based verification and routing rules, and a control plane. Moving rule management into the control plane enabled rapid updates without the usual CI and deployment cycle, while retaining code review for sensitive commands.

## Source excerpt

In 2019 we set out to rewrite the Shopify storefront implementation. Our goal was to make it faster. We talked about the strategies we used to achieve that goal in a previous post about optimizing server-side rendering and implementing efficient caching. To build on that post, I'll go into detail on how the Storefront Renderer team tweaked our load balancers to shift traffic between the legacy storefront and the new storefront. First, let's take a look at the technologies we used.