skip to content

As the lead, would you keep product search in Redis's query engine or run a dedicated search engine, and what evidence decides it?

level: principalimportance: should knowfreq 33%

answer

  1. is Redis already the document store
  2. everything in RAM, rebuilt on load
  3. can a key vanish from search
  4. relevance work you will really do
  5. write the exit trigger down

basics

~20 s

Keep search in Redis when the documents live there durably, the corpus fits in RAM affordably, and its scorers and weights satisfy relevance. Move out when RAM cost, relevance needs or restart behaviour stop fitting, judged on your own measurements.

solid answer

~50 s

I would default to Redis if the hashes are already there and are kept rather than cached, because the index then updates synchronously with no pipeline to run and no second system to operate. I would test that against four things. RAM: documents and index both sit in memory, so I measure `FT.INFO` on a real sample and scale it. Lifecycle: eviction or TTLs remove keys from search, and a restart re-indexes while loading, so a shared cache is the wrong host. Relevance: scorers, `WEIGHT` and synonyms cover a lot, but if the roadmap holds sustained tuning work, I check candidates against a judged query set. Isolation: search shares a process and CPU with everything else, so it may earn its own instance. I would decide from those measurements, keep queries behind an interface and an alias, and write down the trigger that reopens the decision.

go deeper

for a junior

Know that Redis can serve search through FT.CREATE and FT.SEARCH, and that it keeps both the documents and the index in memory.

for a middle

Explain what synchronous indexing saves and what it costs in RAM, and describe what happens to search results when a key expires or gets evicted.

for a senior

Measure instead of arguing: size an index from a real sample, time a restart and a rebuild, and show how the instance's eviction policy changes what search can promise.

for a principal

Own the position and its exit: name the evidence, consider a dedicated Redis instance as a middle ground, keep the choice reversible, and write down the numbers that reopen it.

## The decision There is no universal answer here, and the useful output is a position with named evidence and a trigger that reopens it. Redis 8 changed the starting point: the query engine ships inside Redis Open Source, so a team on a stock Redis 8 binary can try it with no new deployment. The licence since 8.0 is a choice of RSALv2, SSPLv1 or AGPLv3, while 7.2 and earlier stay BSD, so include that in the review if your organisation cares. ## What staying in Redis buys - **No second write path.** New and changed keys are indexed synchronously as part of the write, so a product is searchable when `HSET` replies. - **One system to run.** Replication, persistence and client libraries are the ones you already operate. - **One query surface.** Filter, text, geo and similarity search go through one index and one protocol. Be honest about the first benefit. If the catalogue's source of truth is a relational database, the Redis hashes are themselves a copy that something must keep in sync. You still own a pipeline, and the gain is only that it feeds one store instead of two. ## What it costs | Concern | What Redis does | Evidence to collect | |---|---|---| | Memory | Documents and index both sit in RAM | `total_index_memory_sz_mb` and `used_memory` on a real sample, scaled up | | Restart | An in-memory index's postings are not in the RDB file; documents are indexed again as keys load | A timed restart and replica full sync at target size | | Lifecycle | Evicted and expired keys leave the index | The instance's `maxmemory-policy` and TTL usage | | Scale-out | Every query goes to every shard and merges | Latency at realistic shard count, with `FT.PROFILE` on top queries | | Schema change | `FT.ALTER` only adds, anything else is a rebuild | How long a full rebuild takes | | Relevance | Scorers such as `BM25STD`, `WEIGHT`, `SCORE_FIELD`, synonyms; custom scorers are C extensions loaded at start-up | A judged query set scored on your own data | ## Three questions that usually settle it 1. **Are the keys kept or cached?** This is the sharpest test. On an instance with an eviction policy, the set of searchable products is whatever survived memory pressure. A search that silently loses products is a defect, so search should not share an evicting cache. At the least, it needs its own instance with `noeviction`, where writes fail visibly instead. 2. **Does the corpus fit in RAM at a cost you accept?** Vectors make this urgent, since they can outweigh everything else in the catalogue. Measure instead of guessing, and project growth for the next few years. 3. **How much relevance work is coming?** The Redis docs themselves describe the bundled scorers as basic. A catalogue with clean fields and filter-led browsing may never notice. A team with search as a product, a roadmap of tuning work and someone measuring result quality may need more than those controls. Test that claim against a candidate on the same judged queries; do not assume it from a feature list. ## Isolation and blast radius Search and everything else on the instance share memory and CPU. A heavy `FT.AGGREGATE` or a rebuild competes with cache traffic, and an index scan that hits `maxmemory` stops, after which new documents go unindexed. Whichever way the main decision goes, a **dedicated Redis instance for search** is often the cheap middle ground. It gives you separate memory limits, its own eviction policy and an independent restart, without a new product. ## Making the decision reversible - **Keep queries behind an application interface**, so query strings and reply parsing live in one module. - **Keep the source of truth somewhere you can re-feed from**, so a move means replaying data, not extracting it from the index. - **Query through aliases** with `FT.ALIASADD` and `FT.ALIASUPDATE`, so rebuilds stay routine. ## Write the trigger down Record the numbers that reopen the decision: index plus documents passing a set share of the RAM budget, restart time passing the recovery target, a p99 budget missed at the current shard count, or a relevance goal missed by a stated margin on the judged set. A recorded trigger stops the debate recurring on opinion, and it stops the team drifting past the point where the choice stopped being right.

  • The team says Redis search means no sync pipeline. When is that claim false?
    When Redis is not the source of truth. If the catalogue is mastered in a relational database, the Redis hashes are a copy, and something must keep them current and repair drift. The pipeline still exists; what you avoid is feeding a second downstream store. The claim holds only if the application writes to Redis as the system of record.
  • What is a sensible middle option before adopting a new search product?
    Give search its own Redis instance. That separates the memory limit, the eviction policy, restart timing and query load from the cache, without any new product or query language. Set `noeviction` so writes fail visibly under memory pressure. It also produces clean numbers from `FT.INFO`, which you need for the larger decision anyway.
  • How would you run the comparison fairly if you do evaluate a dedicated search engine?
    Use the same corpus and a judged set of real queries with graded results, and measure result quality, p99 latency under realistic write load, recovery time, and the people needed to run each. Include the cost of the sync pipeline a separate system requires. Decide the pass marks before running it, so the result cannot be argued afterwards.

  • Search in Redis never needs a sync pipeline, whatever holds the source data.
  • An evicted hash stays findable because the index keeps its own copy.
  • A restart is instant because the index is saved in the RDB file.
  • Cluster mode removes the RAM question, so corpus size stops mattering.
  • The bundled scorers are enough for any catalogue, so relevance needs no test.
  • Redis 8's query engine still requires installing a separate module package.

Assumes Redis 8.10; since 8.0 the query engine ships in Redis Open Source under RSALv2, SSPLv1 or AGPLv3, where on 7.x it was a separate module and 7.2 and earlier remain BSD.