High Availability by Offloading Work Into the Background
Moving slow, resource-heavy or error-prone work such as emails, image processing, webhooks and imports out of the request-response cycle into queued background jobs keeps application servers available and responsive. At Shopify that means tens of thousands of jobs per second and traffic spikes up to 170k requests per second. Task queues provide spike buffering, retries, parallelism, prioritization and scheduling, but they bring their own problems: breaking changes to job parameters during deploys, no exactly-once delivery (so jobs should be idempotent), non-transactional queuing (handled with the outbox pattern), local transactions and ordering (handled with SAGA), and long-running jobs that conflict with frequent deploys. Shopify addresses the last one with interruptible, resumable Active Job iteration that checkpoints progress.
Related posts
- Keep the monolith, but split the workloads
incident.io mediumAdeptA Go monolith can get much of the reliability isolation of microservices by splitting workloads into separate deployments of the same binary, instead of breaking it into services. After a bad Pub/Sub message caused an unhandled panic that crashed the web, worker and cron threads together for 32 minutes, incident.io split them into independent Heroku dyno tiers selected by command-line flags. They also gave each class of work its own capped Postgres connection pool and statement timeout, so low-priority jobs such as BigQuery event export or best-effort nudges fall behind rather than exhausting the shared database. The main migration hazard is code that assumes a shared process, such as process-local caches, and the fix is to move that coordination into Postgres or Redis.
- Infrastructure patterns for agentic applications
Render mediumAdept
Agents are long-running, stateful and non-deterministic, so running them inside an HTTP request handler breaks in production. The progression starts with web-queue-worker (enqueue a durable run record and return a run ID), adds idempotency for at-least-once retries and saga-style compensation for partial failures, then moves to workflow engines whose deterministic coordinators replay recorded history while non-deterministic model and tool calls live in steps. Fan-out/fan-in needs explicit partial-failure thresholds (e.g. Promise.allSettled) and concurrency caps or token buckets to avoid contention on shared rate limits. The patterns are then mapped onto Render Workflows (beta), which handles queueing, workers and retries but leaves idempotency, compensation, approvals and cost controls to the application.
- 10 Tips for Building Resilient Payment Systems
Shopify Engineering mediumAdeptTen lessons from Shopify's payment infrastructure for keeping payment systems reliable at scale. Start with low timeouts everywhere: about 1s to open a connection and 5s to read, write or query. Use circuit breakers via Semian, keyed per merchant country so one local acquirer outage stays isolated, and reason about capacity with Little's Law. Track the four golden signals, use structured logs with correlation IDs, and make retries safe with idempotency keys. ULID keys cut INSERT time by 50% versus UUIDv4. The rest covers reconciliation anomalies, load testing against a simulated benchmark gateway, checkout throttling, and incident management and retrospectives.
- How to Reliably Scale Your Data Platform for High Volumes
Shopify Engineering mediumAdeptShopify's Data Platform Engineering team prepared Tier 1 and Tier 2 ingestion and query services for a forecast near-doubling of BFCM 2020 traffic with a five-step reliability process. The steps were to define each service's primary objective (a freshness SLO for the Longboat batch ingester, a latency SLO for Reportify), identify tunable knobs such as job frequency, overlap interval, GKE CPU/memory, BigTable node pools and ProxySQL pools, and constrain those knobs to simulate N-times load. Teams then validated that every alert was actionable with simple runbooks and decided where to scale or tune. The exercise led to cluster scale-ups and job and query tuning, and BFCM ran with a 150% throughput increase and only minor self-healing incidents.
- AI Changed How Spotify Builds. What We Learned (and Fixed) About Quality at Higher Velocity
Spotify Engineering easyNoviceSpotify's quality regressions during its AI ramp-up came not from AI-authored code but from change volume outpacing verification, plus AI-driven compute scarcity that made regional failovers visible to users. Fixes include end-to-end monitoring and scheduler/priority changes for content processing, stronger safeguards and working-hours scheduling for automated fleet updates, doubled reserved edge capacity with tiered failover, and broader long-term quality signals for mobile releases. Internal data shows merged PRs doubling (8,100 to 17,000) with quality work rising from 27% to 31% and no rise in a rebuilt, age-weighted rework rate, though growing PR size and complexity remain open warning signals.