Wiki: Searching Billions of Documents with Redis

For agents: Markdown version · Wiki index · Explore

Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

Summary

The speaker introduces an open-source search engine module built for Redis that enables fast full-text, numeric, and geo-spatial indexing and searching. Traditionally, building indices directly on basic Redis data structures is inefficient, memory-intensive, and hard to maintain. By leveraging the Redis module API written in C, the speaker’s search engine treats Redis as an application framework while offering high write/read concurrency and scalability across multiple instances. Ultimately, developers learn how to perform complex queries and scale search operations efficiently without leaving the Redis ecosystem.

Key points

  • 1:10 Redis provides great, fast data structures, but natively lacks built-in full-text indexing capabilities.
  • 3:32 Attempting to build search indices using sets and sorted sets in Redis is complex, memory-intensive, and slow at scale.
  • 5:43 The introduction of modules in Redis 4.0 via a C API allows developers to extend Redis with new commands and data structures.
  • 6:47 The speaker presents a newly developed open-source search engine written in C that is built specifically for Redis.
  • 9:05 A brief demonstration shows how to create an index with a schema, insert documents, and execute filtered queries.
  • 13:44 The search engine features asynchronous, non-blocking indexing and garbage collection, allowing thousands of concurrent reads and writes.
  • 23:34 Scaling the search engine to billions of documents across multiple servers is achieved by partitioning indices by document IDs and using a coordinator layer.
  • 26:39 Performance benchmarks demonstrate that the Redis search module achieves significantly higher throughput and lower latency than other popular search engines.

Takeaways

  • Use Redis modules to extend functionality and implement custom data structures when native data types fall short.
  • Avoid manually building full-text search indices with standard Redis sets and sorted sets in production due to memory and performance bottlenecks.
  • Partition indices by document ID across multiple instances to scale search workloads effectively over billions of documents.

Questions this talk answers

  • How can you implement full-text search in Redis without using inefficient custom sets?
  • How do Redis modules enable writing custom data structures and commands in C?
  • How does partitioning index data by document ID allow a Redis search cluster to scale to billions of documents?

Technologies

Redis, Python, Java, Go, PHP, Ruby, Elasticsearch, Solr

Tags

c, indexing, open source, performance, redis, scalability, search engine