Distributed Search
A relational LIKE query doesn't scale to millions of records, doesn't rank by relevance, and doesn't tolerate a typo. Search systems are built to do all three.
Advanced
WHERE name LIKE '%sushi%' is a full table scan with no concept of relevance, typo-tolerance, or ranking — workable at small scale, hopeless once the catalog spans millions of items. Distributed search systems are purpose-built for exactly this: fast, fuzzy, ranked full-text lookup at scale.
Documents:
doc1: "Tokyo Sushi Bar"
doc2: "Sushi Express"
doc3: "Tokyo Ramen House"
Inverted index:
"tokyo" -> [doc1, doc3]
"sushi" -> [doc1, doc2]
"ramen" -> [doc3]
"bar" -> [doc1]
Query "tokyo sushi" -> intersect [doc1, doc3] and [doc1, doc2] -> doc1 ranks highest
| Component | Role |
|---|---|
| Primary database | Remains the durable source of truth for the underlying data (e.g. PlateRoute's actual restaurants table). |
| Indexing pipeline | Streams changes from the primary database (often via a message queue or change-data-capture feed) into the search index, asynchronously. |
| Search index (sharded) | The inverted index itself, sharded across nodes the same way any large dataset is (see Data Partitioning & Sharding Strategies) — often by document ID or a domain-specific key like restaurant region. |
| Query service | Accepts search requests, fans them out to the relevant shards, merges and ranks results. |