Cover image for Redis Cookbook

Book description

Redis is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. This book will provide developers with problem and solutions in our useful cookbook style. This is an example-driven ebook.

Table of Contents

  1. Redis Cookbook
  2. Preface
    1. Introduction
    2. Conventions Used in This Book
    3. Using Code Examples
    4. Safari® Books Online
    5. How to Contact Us
    6. Acknowledgements
  3. 1. An Introduction to Redis
    1. When to use Redis
      1. Problem
      2. Solution
        1. Are your application and data a good fit for NoSQL?
        2. Don’t believe the hype
    2. Installing Redis
      1. Problem
      2. Solution
      3. Discussion
        1. Compiling From Source
        2. Installing on Linux
        3. Installing on Windows
        4. Installing on Mac OS X
          1. Installing through MacPorts
          2. Installing through Homebrew
    3. Using Redis Data Types
      1. Problem
      2. Solution
      3. Discussion
        1. Strings
        2. Lists
        3. Hashes
        4. Sets and Sorted Sets
  4. 2. Clients
    1. Using Redis from the Command Line
      1. Problem
      2. Solution
      3. Discussion
    2. Using Redis from Python with redis-py
      1. Problem
      2. Solution
      3. Discussion
    3. Using Redis from Ruby with redis-rb
      1. Problem
      2. Solution
      3. Discussion
    4. Using Redis with Ruby on Rails
      1. Problem
      2. Solution
      3. Discussion
        1. Adding Redis functionality to ActiveRecord models
  5. 3. Leveraging Redis
    1. Using Redis as a Key/Value Store
      1. Problem
      2. Solution
      3. Discussion
        1. Storing application usage counters
        2. Storing object data in hashes
        3. Storing user “Circles” using sets
    2. Inspecting Your Data
      1. Problem
      2. Solution
      3. Discussion
    3. Implementing OAuth on Top of Redis
      1. Problem
      2. Solution
      3. Discussion
        1. Initial setup
        2. Getting a request token
        3. Redirections and consent
        4. Exchanging the request token for an access token
        5. API Access
    4. Using Redis’s Pub/Sub Functionality to Create a Chat System
      1. Problem
      2. Solution
      3. Discussion
        1. Installing the necessary software
        2. Implementing the server side code
        3. Implementing the client side code
        4. Further improvements
    5. Implementing an Inverted-Index Text Search with Redis
      1. Problem
      2. Solution
      3. Discussion
        1. Indexing
        2. Searching
        3. Scoring
        4. Other improvements
    6. Analytics and Time-Based Data
      1. Problem
      2. Solution
      3. Discussion
    7. Implementing a Job Queue with Redis
      1. Problem
      2. Solution
      3. Discussion
        1. Enqueueing
        2. Dequeueing
    8. Extending Redis
      1. Problem
      2. Solution
      3. Discussion
  6. 4. Redis Administration and Maintenance
    1. Configuring Persistence
      1. Problem
      2. Solution
      3. Discussion
        1. Snapshotting
        2. AOF
    2. Starting a Redis Slave
      1. Problem
      2. Solution
      3. Discussion
    3. Handling a Dataset Larger Than Memory
      1. Problem
      2. Solution
      3. Discussion
    4. Upgrading Redis
      1. Problem
      2. Solution
      3. Discussion
    5. Backing up Redis
      1. Problem
      2. Solution
      3. Discussion
        1. Snapshotting
        2. Append-Only Log (AOF)
        3. VM
    6. Sharding Redis
      1. Problem
      2. Solution
      3. Discussion
  7. A. Finding Help
  8. About the Authors
  9. Colophon
  10. Copyright