---
title: "How a shared merchant data service can degrade gracefully"
description: "A shared merchant data service (MDS) using a cache-aside design experienced a cascading failure when cache reads timed out, causing fallback requests to overwhelm the database. The failure amplified because each layer passed more work downstream instead of containing it. To degrade gracefully, the redesign introduced five mechanisms: request classification by operational criticality, a database admission controller with weighted token budgets, bulkheads for connection pools and circuit breakers per class, stale data serving with explicit freshness limits, and client-side caching. Tests showed the admission controller kept database CPU lower under heavy load, and priority controls shed lower-priority work first. The key lesson is that every fallback needs a bounded budget to contain failure rather than spread it."
---

# How a shared merchant data service can degrade gracefully

[Grab](https://yomu.fyi/company/grab) · Kang Huang · Nov 18, 2026

**Type:** Problem & solution

## Summary

A shared merchant data service (MDS) using a cache-aside design experienced a cascading failure when cache reads timed out, causing fallback requests to overwhelm the database. The failure amplified because each layer passed more work downstream instead of containing it. To degrade gracefully, the redesign introduced five mechanisms: request classification by operational criticality, a database admission controller with weighted token budgets, bulkheads for connection pools and circuit breakers per class, stale data serving with explicit freshness limits, and client-side caching. Tests showed the admission controller kept database CPU lower under heavy load, and priority controls shed lower-priority work first. The key lesson is that every fallback needs a bounded budget to contain failure rather than spread it.

## Context

The merchant data service (MDS) is a shared read service for merchant information used by many client applications. It uses a cache-aside design where the database is the source of truth and the cache serves most reads. A cache disruption caused reads to time out and fall back to the database, leading to a cascading failure as increased database load caused more errors and retries.

## Approach / What changed

The redesign implements five mechanisms: (1) request classification into P0 (interactive), P1 (routine), and P2 (deferrable) based on authentication; (2) a database admission controller with weighted token budgets that reject fallback requests when capacity is unavailable; (3) bulkheads with separate cache connection pools and circuit breakers per request class; (4) serving stale data only on approved read paths with explicit freshness limits; and (5) client-side caching to reduce repeated reads and allow fallback to stale values.

## Takeaways

- A fallback without a bounded budget amplifies failure instead of containing it; the cache-to-database fallback behaved as an amplifier during the incident.
- Isolating by workload impact, not physical topology, lets the service choose which work is most likely to survive when capacity is scarce.
- Latency and queues are failure signals; timed-out work still consumes capacity, and retries against a saturated dependency add extra load, not recovery.

## FAQ

### How does the admission controller bound database work?

The admission controller sits before the database on the cache-fallback path. Each fallback query must acquire capacity from a shared token budget before running; if unavailable, the request is rejected promptly instead of queuing.

### What is the role of request classification?

Request classification derives a class (P0, P1, P2) from authentication, allowing the service to prioritize interactive reads over background work. Lower-priority work is rejected early during cache errors to preserve capacity for higher-impact requests.

### How does client-side caching help during cache failures?

Client-side caching reduces the number of requests reaching MDS at peak. When fresh reads are unavailable, clients can fall back to approved stale values within a freshness window instead of failing.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Caching](https://yomu.fyi/topic/caching), [Circuit Breakers](https://yomu.fyi/topic/circuit-breakers), [Database](https://yomu.fyi/topic/database), [Resilience](https://yomu.fyi/topic/resilience)

- Source: [Grab](https://engineering.grab.com/shared-merchant-data-service)
- Source URL: https://engineering.grab.com/shared-merchant-data-service
- Ingested by Yomu: 2026-11-24T06:01:08.586Z

[Read original post](https://engineering.grab.com/shared-merchant-data-service)
