<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/master-search-in-system-design-interviews-part-1-write-path-read-path-indexing-8wedn5jgs" -->

---
title: Master Search in System Design Interviews | Part 1:...
description: A system design walkthrough treats search as a reusable architectural pattern rather than a specific product, framing it around six recurring questions: write...
canonical: https://daily.dev/posts/master-search-in-system-design-interviews-part-1-write-path-read-path-indexing-8wedn5jgs
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Master Search in System Design Interviews | Part 1: Write Path, Read Path & Indexing | daily.dev
og:description: A system design walkthrough treats search as a reusable architectural pattern rather than a specific product, framing it around six recurring questions: write...
og:url: https://daily.dev/posts/master-search-in-system-design-interviews-part-1-write-path-read-path-indexing-8wedn5jgs
og:image: https://api.daily.dev/og/posts/8wEDn5jGS.png
og:image:alt: Master Search in System Design Interviews | Part 1: Write Path, Read Path & Indexing
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Master Search in System Design Interviews | Part 1: Write Path, Read Path & Indexing

**[YouTube](https://daily.dev/sources/youtube)** · 41 min read · 0 upvotes · 0 comments

## Summary

A system design walkthrough treats search as a reusable architectural pattern rather than a specific product, framing it around six recurring questions: write path, read path, scaling, freshness, caching, and recovery. It argues the core mental model is maintaining a read-optimized derived copy of source data rather than picking a search engine vendor. It works through sizing (50M documents, 5,000 queries/sec, 1,000 updates/sec, sub-1-minute freshness) to justify async write propagation and horizontal partitioning, then details the write path using change data capture or transactional outbox instead of dual writes, a durable replayable change log, idempotent versioned upserts to handle duplicate/out-of-order events, and versioned tombstones for deletes. It then covers the read path: gateway, search service (query normalization, authorization filters, deadlines, index generation selection, overfetching), a coordinator merging shard-level top-K results, denormalizing display fields into the index to avoid N+1 database lookups, and cursor-based (search-after) pagination instead of offset pagination. It closes with a brief look at inverted indexes for lexical search and vector indexes for semantic retrieval, noting both plug into the same derived-state architecture. Part two will cover scaling, consistency, caching, failure recovery, and reindexing.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=3MIGT__j6_A>

## Questions this post answers

### Why use change data capture instead of dual writes to update both the database and the search index?

Dual writes create a partial success problem: if the database commit succeeds but the index update fails, search becomes stale, and if the index is updated first and the database transaction fails, search can expose a record that never became canonical truth. Change data capture or a transactional outbox commits the business transaction first, then captures the change durably and indexes it asynchronously, trading a bounded freshness delay for simpler failure handling and durable replay.

_When weighing indexing strategies for a search system, daily.dev surfaces write-path design tradeoffs like this one._

### How should a search indexer handle duplicate or out-of-order events from a change log?

Each event should carry a version token, such as a database log sequence number or monotonically increasing row version, and the indexer should apply an event only if its version is newer than what is already stored for that document. Older or duplicate events are simply ignored, producing effectively-once state even though the underlying transport only guarantees at-least-once delivery.

_Developers designing idempotent write paths often track patterns like this through daily.dev._

### Why should deletes in a search index be versioned instead of handled as a separate cleanup step?

Treating deletion as a special case outside the normal ordering scheme risks a resurrection bug: if a delete at version 11 removes a document but a late update at version 10 arrives afterward, applying it blindly brings the deleted document back, potentially exposing removed or privacy-sensitive content. The fix is to give the delete tombstone a version and apply it through the same monotonic ordering as regular updates, so a late version 10 event is rejected once version 11 has been seen.

_For anyone hardening a search pipeline against stale writes, daily.dev keeps this kind of reliability pattern in view._

## Similar posts on daily.dev

- [How to Prepare for Data Engineering System Design Interviews](https://daily.dev/posts/how-to-prepare-for-data-engineering-system-design-interviews-o6cocikl8) · SitePoint · 0 upvotes · 0 comments
- [Optimizing Search Performance with CQRS: Relational Writes and NoSQL Reads](https://daily.dev/posts/optimizing-search-performance-with-cqrs-relational-writes-and-nosql-reads-3zldezxon) · Sergio Lema · 9 upvotes · 0 comments
- [The multiform read-write separation](https://daily.dev/posts/the-multiform-read-write-separation-09ftiubyw) · ITNEXT · 4 upvotes · 0 comments

---

Tags: [#change-data-capture](https://daily.dev/tags/change-data-capture), [#distributed-systems](https://daily.dev/tags/distributed-systems), [#system-design](https://daily.dev/tags/system-design)

[View this post on daily.dev](https://daily.dev/posts/master-search-in-system-design-interviews-part-1-write-path-read-path-indexing-8wedn5jgs)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Master Search in System Design Interviews | Part 1: Write Path, Read Path \u0026 Indexing","url":"https://daily.dev/posts/master-search-in-system-design-interviews-part-1-write-path-read-path-indexing-8wedn5jgs","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/master-search-in-system-design-interviews-part-1-write-path-read-path-indexing-8wedn5jgs"},"datePublished":"2026-09-21T13:38:14.844Z","dateModified":"2026-11-01T18:48:14.491Z","description":"A system design walkthrough treats search as a reusable architectural pattern rather than a specific product, framing it around six recurring questions: write...","image":"https://i.ytimg.com/vi/3MIGT__j6_A/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/3MIGT__j6_A/sddefault.jpg","isAccessibleForFree":true,"articleSection":"YouTube","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"YouTube","logo":"https://media.daily.dev/image/upload/s--W5zMumpP--/f_auto/v1725350181/logos/youtube","url":"https://daily.dev/sources/youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/master-search-in-system-design-interviews-part-1-write-path-read-path-indexing-8wedn5jgs","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"change-data-capture,distributed-systems,system-design","timeRequired":"PT41M","video":{"@type":"VideoObject","name":"Master Search in System Design Interviews | Part 1: Write Path, Read Path \u0026 Indexing","description":"A system design walkthrough treats search as a reusable architectural pattern rather than a specific product, framing it around six recurring questions: write...","thumbnailUrl":"https://i.ytimg.com/vi/3MIGT__j6_A/sddefault.jpg","uploadDate":"2026-09-21T13:38:14.844Z","duration":"PT41M","url":"https://api.daily.dev/r/8wEDn5jGS","embedUrl":"https://www.youtube.com/embed/3MIGT__j6_A"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"YouTube","item":"https://daily.dev/sources/youtube"},{"@type":"ListItem","position":3,"name":"Master Search in System Design Interviews | Part 1: Write Path, Read Path \u0026 Indexing"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/master-search-in-system-design-interviews-part-1-write-path-read-path-indexing-8wedn5jgs#faq","mainEntity":[{"@type":"Question","name":"Why use change data capture instead of dual writes to update both the database and the search index?","acceptedAnswer":{"@type":"Answer","text":"Dual writes create a partial success problem: if the database commit succeeds but the index update fails, search becomes stale, and if the index is updated first and the database transaction fails, search can expose a record that never became canonical truth. Change data capture or a transactional outbox commits the business transaction first, then captures the change durably and indexes it asynchronously, trading a bounded freshness delay for simpler failure handling and durable replay. When weighing indexing strategies for a search system, daily.dev surfaces write-path design tradeoffs like this one."}},{"@type":"Question","name":"How should a search indexer handle duplicate or out-of-order events from a change log?","acceptedAnswer":{"@type":"Answer","text":"Each event should carry a version token, such as a database log sequence number or monotonically increasing row version, and the indexer should apply an event only if its version is newer than what is already stored for that document. Older or duplicate events are simply ignored, producing effectively-once state even though the underlying transport only guarantees at-least-once delivery. Developers designing idempotent write paths often track patterns like this through daily.dev."}},{"@type":"Question","name":"Why should deletes in a search index be versioned instead of handled as a separate cleanup step?","acceptedAnswer":{"@type":"Answer","text":"Treating deletion as a special case outside the normal ordering scheme risks a resurrection bug: if a delete at version 11 removes a document but a late update at version 10 arrives afterward, applying it blindly brings the deleted document back, potentially exposing removed or privacy-sensitive content. The fix is to give the delete tombstone a version and apply it through the same monotonic ordering as regular updates, so a late version 10 event is rejected once version 11 has been seen. For anyone hardening a search pipeline against stale writes, daily.dev keeps this kind of reliability pattern in view."}}]}
```

