Simplify, Batch, and Cache: How We Optimized Server-side Storefront Rendering - Shopify
Dec 10, 2020

Summary
This post details specific optimizations for the new storefront rendering engine, including the use of MySQL's multi-statement feature to reduce database round trips, the implementation of a thin data mapping layer with plain old Ruby objects instead of a full ORM, a book-keeping mechanism for eager-loading frequently needed data, and multiple caching layers (in-memory, node-local Redis, full-page, and database query results). It also describes the Liquid object memoizer to ensure a single instance of an object is used throughout a request lifecycle.
More from the Storefront Rendering Performance trail
- Horizontally scaling the Rails backend of Shop app with Vitess - Shopify
- The Vitality of Core Web Vitals - Shopify
- How Shopify Dynamically Routes Storefront Traffic - Shopify
- How to Do an In-depth Liquid Render Analysis with Theme Inspector - Shopify
- How Shopify Reduced Storefront Response Times with a Rewrite - Shopify