Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Josiah L. Carlson

Summary Redis in Action introduces Redis and walks you through examples that demonstrate how to use it effectively. You'll begin by getting Redis set up properly and then exploring the key-value model. Then, you'll dive into real use cases including simple caching, distributed ad targeting, and more. You'll learn how to scale Redis from small jobs to massive datasets. Experienced developers will appreciate chapters on clustering and internal scripting to make Redis easier to use. About the Technology When you need near-real-time access to a fast-moving data stream, key-value stores like Redis are the way to go. Redis expands on the key-value pattern by accepting a wide variety of data types, including hashes, strings, lists, and other structures. It provides lightning-fast operations on in-memory datasets, and also makes it easy to persist to disk on the fly. Plus, it's free and open source. About this book Redis in Action introduces Redis and the key-value model. You'll quickly dive into real use cases including simple caching, distributed ad targeting, and more. You'll learn how to scale Redis from small jobs to massive datasets and discover how to integrate with traditional RDBMS or other NoSQL stores. Experienced developers will appreciate the in-depth chapters on clustering and internal scripting. Written for developers familiar with database concepts. No prior exposure to NoSQL database concepts nor to Redis itself is required. Appropriate for systems administrators comfortable with programming. What's Inside Redis from the ground up Preprocessing real-time data Managing in-memory datasets Pub/sub and configuration Persisting to disk About the Author Dr. Josiah L. Carlson is a seasoned database professional and an active contributor to the Redis community. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. Table of Contents PART 1 GETTING STARTED Getting to know Redis Anatomy of a Redis web

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on, example-driven guide to Redis that takes you from the five core data structures to building real-time web features, caching layers, and scalable deployments—ideal for developers and sysadmins who want to solve practical problems with an in-memory database. 【Book Arc】 - **Opening (~0%–9%)**: Introduces Redis as a fast, open-source, in-memory key-value store. The author sets the tone: this is a practical book for "getting things done," not a sterile API reference. It outlines the book's three-part structure: basics, commands/administration, and scaling. - **Early (~9%–28%)**: Covers the five fundamental data structures—STRINGs, LISTs, SETs, HASHes, and ZSETs—with console examples. Builds a complete article voting and aggregation site to demonstrate how these structures work together, introducing commands like SADD, ZINCRBY, and HINCRBY. - **Early (~28%–38%)**: Moves into web application patterns. Shows how to manage user sessions, implement a shopping cart, and build a page caching layer. Includes a crucial lesson on memory management: caching everything can exhaust RAM, so you need strategies like token cleanup and scheduled re-caching. - **Middle (~38%–47%)**: A deep dive into Redis commands, organized by data type. This section is a practical reference for the 95% of commands you'll use in real applications, including blocking list operations (BLPOP/BRPOPLPUSH) for messaging and advanced HASH operations like HINCRBYFLOAT. - **Middle (~47%–end of excerpts)**: Explores sorted sets (ZSETs) in detail and introduces the publish/subscribe (pub/sub) pattern. The excerpts show how ZSETs store member-score mappings for ordered data, and how pub/sub enables real-time messaging between clients. 【Key Takeaways】 - **Redis is a problem-solving tool, not just a cache** (Early): Its unique combination of being in-memory, remote, persistent, and scalable lets you build solutions beyond simple key-value lookups. The book's goal is to shift your thinking from "tables and rows" to "which Redis structure fits best." - **Five data structures form the core** (Early): STRINGs, LISTs, SETs, HASHes, and ZSETs each have distinct semantics. ZSETs are unique to Redis and are invaluable for maintaining ordered data like leaderboards or time-based rankings, as shown in the article voting example. - **Real-time thinking is the default** (Early): Almost every example in the book solves a problem in real time, except for task queues. This mindset helps you design for immediate data updates and low-latency responses. - **Memory is a finite resource that needs active management** (Early): The web application chapter demonstrates that caching every page can exhaust RAM. Solutions include cleanup functions that remove old session tokens and scheduled re-caching of inventory data, showing that "cache everything" is rarely the right answer. - **Commands are the building blocks for your own solutions** (Middle): Chapter 3 is a command reference organized by structure. It covers blocking pops for queues, HASH bulk operations, and sorted set commands, giving you the vocabulary to implement patterns like messaging and task queues. - **Publish/subscribe enables real-time communication** (Middle): Redis's pub/sub feature allows clients to subscribe to channels and receive messages instantly. This is useful for scenarios where you need to push updates to multiple listeners, such as live feeds or notifications. 【Reading Tips】 - **Skim the command tables in Chapter 3**: You don't need to memorize every command upfront. Use this chapter as a reference when building your own applications, and focus on the examples that show how commands combine to solve problems. - **Deep-read the article voting example in Chapter 1**: This is the foundational case study that ties all five data structures together. Understanding it will make later chapters on web applications and scaling much easier to follow. - **Pay attention to the "why" behind each pattern**: The author often revisits earlier solutions to improve them. Note where these callbacks occur, as they teach you how to evolve your own designs. - **Use the provided test runners**: The book includes source code with test runners for each chapter. If an example is confusing, running the tests will show you exactly how each function is used. - **Don't get stuck on Python specifics**: All examples are in Python, but the focus is on Redis commands and logic. If you're not a Python developer, translate the command sequences to your language of choice. 【Coverage Limits】 The excerpts cover the book's introduction, core data structures, web application patterns, and a substantial portion of the command reference. They do not cover later chapters on data persistence, replication, sharding, Lua scripting, or advanced administration topics.
Excerpt 1
n PDF, Kindle, and ePub formats from Manning Publications. Table of Contents PART 1 GETTING STARTED Getting to know Redis Anatomy of a Redis web IN ACTION Jo...
View in text
Excerpt 2
of commands. A more complete (but partial) listing of com- mands for each type can be found in chapter 3. If you need a complete com- mand listing with docum...
View in text
Excerpt 3
be written to be run as a daemon process (like list- ing 2.3), to be run periodically via a cron job, or even to be run during every execution (section 6.3 a...
View in text
Excerpt 4
'hash-key2', 'num') existence of specific keys. 1L >>> conn.hexists('hash-key2', 'num') Incrementing a previously nonexistent key True in a hash behaves just...
View in text
Excerpt 5
ata changed since the last snapshot. For some applications, this kind of loss isn’t acceptable, and you should look into using append-only file per- sistence...
View in text
Excerpt 6
ime for clients (except in the case of blocking LIST pops), Redis doesn’t lock data during WATCH. Instead, Redis will notify clients if some- one else modifi...
View in text
Excerpt 7
, context, type, value, timeout=5): Set up the destination destination = 'stats:%s:%s'%(context, type) statistics key. start_key = destination + ':start' pip...
View in text
Excerpt 8
tems. To ensure that we’re not adding and removing the same items, as would be the case if two members of the same guild were trying to message the same user...
View in text
Tags
AI categories
DatabaseBackendTechnology
ISBN: 1617290858
Publish Year: 2013
Language: English
Pages: 320
File Format: PDF
File Size: 8.0 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…