Typesafe Queries for Redis
Blog post from Upstash
Upstash for Redis introduces @upstash/query, a TypeScript SDK designed to address the challenge of querying data in Redis, which traditionally does not support querying by arbitrary properties. This SDK allows users to create secondary indexes, enabling efficient data retrieval by mapping search terms to documents within collections, akin to tables in relational databases. The SDK simplifies the process by automatically updating indices whenever documents are added, modified, or deleted, ensuring data consistency without manual intervention. The quick start guide demonstrates how to set up a collection and create a searchable index, allowing users to perform fast searches and filters. This tool expands the querying capabilities of Redis by allowing multiple indices on the same collection, thus offering more flexible data interaction options.