Book Image

Redis Applied Design Patterns

By : Arun Chinnachamy
Book Image

Redis Applied Design Patterns

By: Arun Chinnachamy

Overview of this book

<p>With new data stores making their way onto the market, it's necessary for businesses to understand the features and techniques to use data stores most effectively. Redis Applied Design Patterns is designed to guide you into the world of Redis and will help you understand how business problems can be solved using Redis in your application stack.</p> <p>This book introduces you to the NoSQL way of thinking and how it is different from SQL. It helps you understand various functionality of Redis through a series of use cases designed for you to learn the more complex and less well-known features of Redis in an incremental way. By the time you've read this book, you will be capable of designing a system using Redis. This book will guide you through various use cases along with code samples, easy-to-understand diagrams, and tips to help you take advantage of Redis. The book explains the benefits of adding Redis to the application stack and discusses various practical use cases for Redis such as the caching system, commenting system, and social networking.</p>
Table of Contents (18 chapters)

Chapter 6. Redis in Autosuggest

In Chapter 5, Redis in an E-commerce Inventory System, we saw how to use Redis in an e-commerce catalog for product and inventory management. We also saw how to perform a catalog search. While Redis is not the best solution for searching a catalog, it is ideal when it comes to implementing an autosuggest and basic facet search.

In this chapter, we are going to see how to use Redis to build a basic autocomplete or autosuggest server. Also, we will see how to build a faceting engine using Redis. To build such a system, we will use sorted sets and operations involving ranges and intersections. To summarize, we will focus on the following topics in this chapter:

  • Autocompletion for words

  • Multiword autosuggestion using a sorted set

  • Faceted search using sets and operations such as union and intersection