Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Grab Engineering 10 min read Case study mediumAdept

How a shared merchant data service can degrade gracefully

Grab's merchant data service suffered a cascading failure when cache read timeouts fell back to the database, retries piled on, and availability collapsed. The redesign rests on one rule: a fallback is only safe if its work is bounded. Requests get a priority class derived from authentication. A weighted, cross-instance token budget sits in front of the database on the fallback path, and deferrable traffic is rejected outright on cache errors. Per-class connection pools and circuit breakers act as bulkheads, scoped runtime throttles give responders control without deploys, and an opt-in SDK cache serves stale values within explicit freshness windows.

Assumes: cache-aside patterncircuit breakersrate limiting

Related posts

  • 10 Tips for Building Resilient Payment Systems

    Shopify Engineering mediumAdept

    Ten 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.

  • Failure is inevitable: Learning from a large outage, and building for reliability in depth at Datadog

    Datadog Engineering mediumAdept

    A March 2023 unsupervised global update knocked out connectivity to 50–60% of Datadog's Kubernetes nodes, yet the platform appeared fully down because services were designed to stop rather than show partial data. Instead of only fixing the trigger, Datadog rebuilt for graceful degradation. Changes include persisting data at intake before acknowledging receipt, letting pipelines skip backlogs to serve live data first, retries with backoff and earlier dead-letter queues, Kubernetes PriorityClass and faster autoscaling, removing a shared Cassandra tag cache from the critical path, cluster-local Vault instances, break-glass paths around circular recovery dependencies, and automated chaos testing. The general lessons are to persist early, prioritize real-time data, avoid global control systems, and scrutinize retries and caches.

  • Slack’s Incident on 2-22-22

    Slack Engineering mediumAdept

    A Consul agent rolling restart caused Mcrib, Slack's memcached control plane, to replace and flush cache nodes, dropping hit rates during peak traffic. A cache-fronted Group DM membership query hit a Vitess keyspace sharded by user, so every miss became a scatter query across all shards. Database load grew superlinearly, queries timed out, caches couldn't refill, and client retries kept the system stuck in a metastable cascading failure. Recovery required throttling client boots, fetching only missing keys, reading from replicas and later moving the query to a channel-sharded table; Mcrib's very efficiency at replacing nodes increased cache churn and worsened the outage.

  • More Reliable Connections to Your Repls

    Replit mediumAdept

    Replit split reverse WebSocket proxying out of Conman, its container manager on GCE VMs, into a dedicated service called Eval that sits between clients and Conman VMs. Previously, frequent Conman rollouts could disconnect a client twice (once when the proxying VM died and again when the target VM died), complicated autoscaling, and blurred the cause of session failures. With Eval, Conman updates cause at most one disconnect, Eval drains connections with a 30h+ shutdown grace period, scales independently on active connections, and its observability pinpoints whether failures come from token validation, Controlplane lookups or the remote Conman connection.

  • How we scaled fast, reliable configuration distribution to thousands of workload containers

    Datadog Engineering mediumAdept

    Datadog replaced on-demand per-tenant config loading (database reads plus Kafka cache-invalidation messages) with a context-publisher that snapshots all tenants' configuration into RocksDB blobs in cloud storage and streams individual updates over Kafka. Because context data is only megabytes in total and changes thousands of times per day, every workload container can hold a full local replica. Containers download the blob at startup, apply streamed updates, and refresh the snapshot roughly every 10 minutes, so they keep working through a full outage of the central database. The design deliberately puts a tiny, externally unreachable service in charge and avoids bimodal fallback paths that would go untested and could overload the database.

The quest for software engineering knowledge.

Look:
Layout: