techdiagrams.net
← All templates

E-commerce search platform

CQRS split: the catalog writes to Postgres, CDC feeds the inverted index, and queries fan out to shards with hedging and an ML re-rank stage.

Open in editor — free, no login Download JSON
READ MODEL — DISPOSABLE, REBUILDABLEWRITE MODEL — BORING ON PURPOSEqueryfan-outgather top-200top-20, re-rankedwritesCDCchangesupsert · idempotentShoppertypes 'red running shoes'Search APIscatter-gather coordinatorShard 1terms a–hShard 2terms i–qShard 3terms r–zRe-rankerML · top-200 → top-20Catalog Servicethe write sideCatalog DBsource of truthChange StreamCDC → index upsertsIndexeranalyze · tokenize · upserthedging: if a shard hasn't answered by p95,fire a backup request to its replica and takethe first response. tail latency, tamed.

What this design does

Search is the read model taken to its logical extreme: the write side stays a boring relational catalog, CDC streams every change into a sharded inverted index, and the query side fans out, gathers, and re-ranks with a model. Hedged shard requests keep p99 flat when one shard has a bad day.

The patterns it composes

Import it, attach your own numbers, and verify the design against failures — or read the engineering notes.