Digital Product Engineering5.12 Search Infrastructure
VOL. V · CH. 5.12 · BACKEND SYSTEMS

Search Infrastructure

Why a plain database query stops being enough the moment a search box needs to feel fast and forgiving.

DivisionBackend / Data
DifficultyAdvanced
Prerequisites5.1
Related3.21 5.15
1 min read · 322 words

5.12.1Definition

Search infrastructure is a dedicated system — Elasticsearch, Algolia, Meilisearch, or a database's built-in full-text search — optimized for fast, ranked, typo-tolerant lookups across large text datasets, as distinct from the exact-match filtering a standard SQL WHERE clause performs well.

5.12.2Why It Exists

Relational databases are built for exact and range matching, not for ranking relevance, tolerating typos, or searching across many fields simultaneously with weighted importance — the actual expectations users have of a search box (3.21). Dedicated search infrastructure exists to serve that specific access pattern well, typically as a separately-maintained index kept in sync with the primary database rather than the source of truth itself.

5.12.3When Plain Database Search Is Enough

SignalDatabase search is fineDedicated search engine needed
Dataset sizeThousands of rowsHundreds of thousands+
Query needsExact/prefix match on one or two fieldsTypo tolerance, relevance ranking, faceting
Latency expectationA second or two is acceptableSub-100ms, instant-as-you-type

5.12.4Common Mistakes

  • Adopting Elasticsearch for a dataset a database index would handle fine, adding an entire second system to keep in sync for no measurable user benefit.
  • Letting the search index drift out of sync with the primary database, with no reliable re-indexing process when underlying data changes.
  • Building "search" as a simple LIKE '%query%' query on a large table, which cannot use standard indexes efficiently and degrades badly as data grows.

5.12.5Best Practices

  • Start with the database's native full-text search capability; migrate to dedicated search infrastructure only once a specific, measured limitation appears.
  • Treat the search index as a derived, rebuildable copy — never the source of truth for the underlying data.
  • Build an explicit, monitored re-indexing pipeline rather than assuming the index will stay in sync on its own.
Real-World ExampleAlgolia's hosted search product is a common choice for marketplaces (2.16) and e-commerce platforms (2.3) that need instant, typo-tolerant, faceted search without operating Elasticsearch infrastructure themselves.