System design Level 4 This level · 10 of 15
Hard system-design search

How would you scale product search across regions and large catalogs?

The 30 second answer

I scale reads by replicas and by splitting markets onto separate indices or clusters closer to shoppers. I keep primary shard counts intentional so I can add nodes without heroic resharding. Cross-region active-active search usually means independent indexes fed by replicated events, accepting divergence. Global one-index designs hurt latency and blast radius. Capacity plans should include Cyber Week style peaks for both queries and catalog updates.

Could you say this in an interview?

Horizontal read scale. More replica shards serve more searches; Adaptive Replica Selection (Elasticsearch) prefers healthier copies. Dedicated coordinators absorb scatter/gather merge work.

Partition by geography / catalog. Separate indices or clusters per market (or market group) keep analyzers, assortments, and failure domains local. Zalando's public posts describe multi-cluster deployments, market grouping, and moving a market between clusters with allocation settings, replica reduction, and paused ingest.

Primary shard strategy. Historically Elasticsearch fixed primary shard count at index creation; modern versions add more flexibility, but the interview point remains: over-sharding raises costs and cluster state, under-sharding prevents scaling out. Elasticsearch in Action discusses over-sharding and aliases for reindex; verify against current Elastic docs for your version.

Multi-region (Opinion). For active-active:

  • Replicate events, rebuild indexes regionally (avoid cross-region scatter/gather on every keystroke).
  • Keep sticky user affinity when personalization caches are regional.
  • Accept brief cross-region divergence; define which region is authoritative for a market.

Blue/green for risky changes. Mapping changes, major version upgrades, and embedding model swaps are safer as new clusters/indexes with shadowed traffic (Zalando ES 8 migration; ranking paper embedding refeed).

Sources (4)
  1. Elasticsearch — Scale clusterelastic.co
  2. Zalando Engineering — ES 7 to 8 migrationengineering.zalando.com
  3. Zalando Engineering — Failing to Auto Scale Elasticsearch in Kubernetes (Lounge ES; zone-awareness drain lesson — not core search, still a useful ops story)engineering.zalando.com
  4. DDIA — rebalancing / shard counts (study map theme 5)dataintensive.net
Previous
Next