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)

Frequency capping


In our previous solution, there was a possibility of the same ad being shown to the same user over and over again until the budget was exhausted as we deliver in order to maximize eCPM for the website. To solve this issue in the advertising world, the advertiser is given the ability to limit the frequency with which the same user is presented with the same ad. This methodology is called frequency capping.

As frequency capping is based on the users, we need to maintain a data store to manage the user profile information, such as the impression count for each ad and conversion. The user_id will usually be maintained as a cookie in the user's browser in order to track the user across the session. Every time a request for an ad comes to the network, the user_id from the cookie is used in the ad-serving decision.

Impression information for a user should be stored per campaign in order to make sure that the ad from the same campaign is not shown every time. This can be achieved...