Index your Valkey Cache and Start Searching
Blog post from Aiven
Aiven for Valkey offers the Valkey Search module, providing enhanced search capabilities for existing data caches without requiring a new datastore. This is exemplified by Needle & Yarn, a small online shop that integrates real-time search functions over its existing product cache, allowing for efficient querying and indexing of popular yarn designs and patterns based on customer interactions. The cache system uses structured fields with a time-to-live mechanism to maintain active records, and the Valkey Search index allows for various field types—TEXT, TAG, NUMERIC, and VECTOR—to enable comprehensive search functionalities. The vector search capability, which is difficult to replicate without a separate system, supports similarity searches alongside structured fields, allowing for complex queries that combine different data types. This setup is not intended to replace existing systems like PostgreSQL or dedicated search engines but rather to enhance the performance and utility of data already in use. Needle & Yarn's implementation showcases how this approach can be applied in various contexts, including AI-driven assistants, customer support, and content management systems, providing real-time search and recommendation features that are adaptable to rapidly changing data environments.