How We Built Oxygen: Hydrogen’s Counterpart for Hosting Custom Storefronts
Oxygen, Shopify's hosting platform for Hydrogen custom storefronts, assembles GitHub, GitHub Actions and Cloudflare Workers with first-party Shopify services such as the CDN, Admin API and identity. Shopify briefly built its own V8-isolate infrastructure but chose Cloudflare's Workers for Platforms instead to ship faster and reduce scale and security risk. A Gateway Worker checks authorization and routes requests to per-storefront workers via the Dynamic Dispatch API, and a Trace Worker forwards logs and metrics to a separate Grafana/Loki/Cortex/Tempo stack that keeps merchant-facing telemetry apart from internal metrics.
Related posts
- Building Blocks of High Performance Hydrogen-powered Storefronts
Shopify Engineering easyNoviceHydrogen, Shopify's React-based storefront framework, targets the tension between fast loading and personalized, dynamic commerce by combining React 18 streaming SSR with Suspense, React Server Components, cache-aware data fetching, and per-page edge caching. Streaming SSR sends the HTML shell immediately for a fast TTFB, then streams data and progressively hydrates components, avoiding the client-side fetch waterfall that slows LCP under CSR. On Oxygen, a V8 isolate worker runtime colocated with Shopify data, server components query the Storefront API at near-localhost latency, and third-party fetches get default cache keys, TTLs and stale-while-revalidate. Static pages can be served from the CDN edge, with the choice of SSR, client fetching or edge delivery made per page and per component.
- How We Built Hydrogen: A React Framework for Building Custom Storefronts
Shopify Engineering mediumAdeptHydrogen, Shopify's React framework for custom storefronts, was built on React Server Components, React 18 streaming SSR and Vite, chosen over static JAMStack approaches because commerce pages are inherently dynamic. Component-level data fetching replaced route loaders, and a preload cache hoists nested queries so they run in parallel instead of in network waterfalls. Removing bloated exported GraphQL fragments and adding a logger for unused query fields cut some demo store route load times in half. Rigid "magical" context-based components were dropped in favor of leaner primitives, and the team describes its early reverse-engineered RSC implementation and collaboration with the React, Vite, Vercel and Cloudflare teams.
- Railway vs Cloudflare: How Their Architectures Differ and When to Use Each
Railway mediumAdeptRailway and Cloudflare's Developer Platform feel similar on the surface but rest on opposite compute models. Railway runs long-lived regional containers with stable in-memory state, persistent volumes and up to 32 vCPU/32 GB per instance. Cloudflare Workers are edge-first, single-threaded V8 isolates capped at 128 MB memory and CPU-time limits, with no filesystem or reliable global state, so state needs Durable Objects, KV, D1, R2 or external databases via Hyperdrive. The recommended pattern is to combine them, with Cloudflare as the global front door (CDN, caching, routing, security) and Railway hosting stateful backends, databases and long-running work.
- Quick: An internal hosting platform for the AI era
Shopify Engineering mediumAdeptQuick is Shopify's internal static hosting platform: each site is a folder in a Google Cloud Storage bucket, mounted via gcsfuse and served by a wildcard NGINX config behind Identity-Aware Proxy, with `quick deploy` wrapping gcloud rsync. A single shared backend (originally Node.js on CloudSQL, later rewritten in Go) exposes zero-config client-side APIs for a Firebase-style realtime database, file uploads, LLM calls via an AI proxy, BigQuery, websockets and employee identity, which is only safe because everything sits behind IAP. The platform deliberately has no permissions or site ownership and refuses features like cron or custom backends. It hosts 50,000+ sites built by over half the company, largely with AI agents, on one $200/month VM with rate limiting added after abuse by batch jobs.
- How Shopify Dynamically Routes Storefront Traffic
Shopify Engineering mediumAdeptShopify shifted storefront traffic from its legacy Rails storefront to a rewritten renderer using a rule-based routing system in nginx/OpenResty Lua load balancers, with rules stored as JSON in a control plane and managed via the spy chatbot so changes skip CI and deploys. Each rule specifies filters, target shop IDs, and sampling rates for rendering, forward verification (legacy renders, new storefront checked), reverse verification, and self-verification against the local region's deployment. Rules are checked in the nginx rewrite phase, verification is decided in the header filter phase, and duplicate requests are sent asynchronously via nginx timers in the log phase so clients never wait on both upstreams. The same mechanism let the team mirror traffic to a separate deployment disconnected from Redis to test resilience before BFCM.