R255 · Infrastructure for agents at scale › Consistency and storage tradeoffs

talabat: fit the store to the data, with a four-phase shadow migration

Read the original

Authors Delivery Hero

storagedata-modelingmigrationdynamodbcostcase-study

Source: From Default to Deliberate: Rethinking Storage at talabat on the Delivery Hero tech blog (16 Nov 2026), by Abdelrahman Elsaidy and Suvan Singh (Principal Engineers) and Ahmed Essam (Staff Software Engineer), shared on LinkedIn by Brenn Hill.

The trigger

talabat, a food and grocery delivery platform, set out to isolate each country's stack (Country-Based Deployment, eight markets) on the way to multi-region active-active. Giving every market its own relational cluster would have multiplied four costs: a minimum running cost per cluster whatever the utilization, ID sequences that collide across independent databases, a normalized schema copied everywhere, and eight times the operational work (schema migrations, failover, replication). Instead of asking how to replicate the databases, the team asked which datasets were actually relational.

The core idea: an aggregate is a document

A cart has one identity (a customer at a vendor) and groups parts that mean nothing alone; it is read whole and changed whole. The relational model spread it across tables and rebuilt it with a fan-out of queries on every read. Stored as one DynamoDB item, one read and one write replace the fan-out.

The boundary matters as much as the grouping. The cart shows prices, menu items, delivery times and promotions but does not own them, so it stores a snapshot of those values and re-validates at checkout rather than on every read. That is what keeps a document self-contained instead of becoming a distributed join.

Why it is cheaper per country

DynamoDB bills for traffic served, not instances, so eight per-country tables cost about the same as one for the same total traffic: no cost floor per market. Multi-region durability and per-item expiry come with the store, removing connection pools, read-replica routing, vacuuming and cleanup jobs. Carts and orders, the two highest-traffic stores on the ordering path, are now live for all customers with a reported 70 to 90% storage cost reduction, holding whether they run as one table or eight.

The discipline it demands

The authors are explicit that this is not NoSQL for everything. PostgreSQL stays for data that is genuinely relational. They name two shapes to avoid: forcing relational data into a document store, and spreading one document across many tables to fit the relational model.

The four-phase shadow migration

  1. Abstraction: put storage behind an interface, no behavior change.

  2. Build: implement the DynamoDB version behind it, tested but dark.

  3. Shadow: write to both stores, read from the old one, compare every result in the background.

  4. Rollout: by cohort (internal, small percentage, up to 100%), country by country, then retire the old store.

Graduation is gated on numbers held for several days: mismatch and failure rates near zero, latency at or below the old store, no data loss. The team calls shadow mode non-negotiable and says the comparison layer deserves as much investment as the migration.

Making it repeatable

Every team now runs a three-step decision: evaluate access patterns (whole-unit or cross-row, transactions, record growth, single or multi-region writes), pick the data model, then the store (DynamoDB for document-shaped operational data, S3 for large and cold objects, PostgreSQL for relational). It is backed by a storage-decision guide and a migration playbook in their tooling, where an AI agent inspects a service's code, recommends a storage model and drafts the migration plan for human review. The post gives no data on how well that agent performs.

Tradeoffs and open questions

Review checklist

Connections

See R255 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.