Shopify

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

Dec 10, 2020
Simplify, Batch, and Cache: How We Optimized Server-side Storefront Rendering - Shopify
SummaryAI, from the source post

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