Redis: A Beginner's Guide (2nd Edition) cover

Redis: A Beginner's Guide (2nd Edition)

Rating 3.9
Word count
165K words
Chapters
13
ISBN
9787115388407

Tags

Summary

Redis Essentials (2nd Edition) is a beginner's guide to Redis by Li Zihua, written for developers new to Redis. In an accessible, task-driven style, it takes readers from installation and configuration all the way to production practice. The book first answers "What is Redis and why use it?", covering its history, storage structures, in-memory storage, and persistence. It then explains installation on POSIX systems, OS X, and Windows, along with startup and shutdown, the command-line client, configuration files, and multiple databases. The main section focuses on the five data types—strings, hashes, lists, sets, and sorted sets—each presented in a structure of introduction, commands, practice, and additional commands, tied together by building a blog system as a running example that helps readers apply commands to real scenarios. Advanced chapters discuss transactions and WATCH, expiration and access rate limiting, cache implementation, SORT, task queues and pub/sub, pipelining, and memory-saving techniques. Later chapters cover Lua scripting, the RDB and AOF persistence methods, replication and Sentinel, cluster sharding, and security, communication protocol, and management tools. The appendix includes Redis command properties, a configuration parameter index, and a CRC16 implementation reference. The second edition updates version-related content and language practice from the first edition, including usage examples for four clients: PHP, Ruby, Python, and Node.js. Concise in length, the book serves as a map to the world of Redis and is intended for use with the accompanying e-book on the Asynchronous Community platform.

Editor's review

Redis 是后端开发绕不开的基础设施,但市面上的资料往往一上来就讲源码、讲架构,把新手劝退。这本书的好处正好相反:它先讲清楚“这是什么、为什么要用、什么时候出现的”,再用一条博客系统的任务线把五种数据类型和常用命令串起来,读完能立刻在自己的项目里动手,而不是停留在背诵命令表。 作者李子骅有 Web 后端一线的工程经验,讲事务、过期时间与访问频率限制、缓存、任务队列、发布/订阅这些内容时,都能指出实际用途,而不是罗列语法。进阶部分涵盖 Lua 脚本、RDB 与 AOF、复制、哨兵和集群,篇幅不大却搭起了完整知识地图,适合当第一部系统性读物。 需要提醒的是,本书成书于 2015 年,命令细节和集群方案已有更新(例如部分命令已被弃用、缺少新数据类型与新版集群的介绍)。因此建议把它当作“入门地图”快速通读,遇到具体命令和新特性时再对照官方文档补课,这样效率最高。213 页篇幅,一周左右即可读完并完成主要实践。

Who it's for

A good fit for

  • 完全没有接触过 Redis、需要从零建立整体认知的后端开发者
  • 希望系统学习 Redis 数据类型与常用命令的在校学生和自学者
  • 想了解缓存、消息队列、持久化、复制与集群等实践用法的人
  • 做 PHP、Ruby、Python、Node.js 开发、需要选型客户端的工程师

Not a good fit for

  • 需要深入源码实现、数据结构底层原理的中高级工程师
  • 想查阅 Redis 最新版本特性与新版集群方案的读者
  • 期待命令手册式大全、逐条详尽查询的工具书使用者

Reading tips

  1. 务必边读边练:按第2章装好 Redis 并启动命令行客户端,第3章的命令逐条敲一遍,理解返回值再往下走。
  2. 把第3章和第4章的博客系统案例当作练手项目,自己重写一遍,比只看代码效果更好。
  3. 读第5章时只精读自己熟悉的语言,其余语言浏览思路即可,不必强求全部上手。
  4. 遇到已被弃用的命令或缺失的新特性,随手对照 Redis 官方文档更新笔记,避免记下过时用法。

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. Preface
  2. Chapter 1 Introduction (1.1 History and Development; 1.2 Features: Storage Structures, In-Memory Storage and Persistence, Rich Functionality, Simple and Stable)
  3. Chapter 2 Preparation (2.1 Installing Redis: POSIX/OS X/Windows; 2.2 Starting and Stopping Redis; 2.3 Command-Line Client; 2.4 Configuration; 2.5 Multiple Databases)
  4. Chapter 3 Getting Started (Warm-Up; String Type; Hash Type; List Type; Set Type; Sorted Set Type)
  5. Chapter 4 Advanced (Transactions; Expiration Time; Sorting; Messaging; Pipelining; Saving Space)
  6. Chapter 5 Practice (PHP and Redis; Ruby and Redis; Python and Redis; Node.js and Redis)
  7. Chapter 6 Scripting (Overview; The Lua Language; Redis and Lua; In-Depth Scripting)
  8. Chapter 7 Persistence (RDB Mode; AOF Mode)
  9. Chapter 8 Clustering (Replication; Sentinel; Clustering)
  10. Chapter 9 Management (Security; Communication Protocol; Management Tools)
  11. Appendix A Redis Command Properties
  12. Appendix B Configuration Parameter Index
  13. Appendix C CRC16 Implementation Reference

FAQ

这本书适合零基础读吗?需要先会 Linux 吗?
适合零基础。作者假定读者没有 Redis 背景知识,从安装讲起;若有 Web 后端或 Linux 使用经验会更顺手,但没有也能读,Windows 系统同样有安装章节。
第2版相比第1版主要改了什么?
第2版于 2015 年出版,主要在版本相关内容和语言实践部分做了更新,调整了安装、配置与客户端示例,并继续保留博客系统这条实践主线。
书里的内容会不会过时?
成书于 2015 年,部分命令已被弃用,也未涵盖 HyperLogLog、Stream 等新数据类型和新版集群方案。作为概念与命令入门地图仍然够用,细节建议对照官方文档。
这本书和《Redis 设计与实现》有什么区别?
本书是入门实践书,侧重于怎么用、什么场景用;《Redis 设计与实现》偏底层,讲数据结构与内部机制。通常先读本书入门,再读后者深入。
需要按顺序从头读到尾吗?
建议第1至4章按顺序读,这是核心;第5至8章可按需跳读——不涉及多语言客户端可略过第5章,暂不上生产可先读持久化再读集群。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

More by the same author

Top rated in the same category