Redis in Action cover

Redis in Action

Rating 4.0
Word count
395 words
Chapters
26
ISBN
9787115402844

Tags

Summary

Many Redis books only teach commands; this one teaches how to use them. The author, Josiah L. Carlson, has long been active on the Redis mailing list and in the open-source community, and nearly every concept in the book lands on a real project you can run: from small features like article voting, shopping carts, and web page caching, all the way up to distributed locks, semaphores, task queues, ad targeting, and a social network, and finally memory compression, sharded scaling, and Lua scripting. This build-it-first, then-optimize, then-scale approach lets readers see the reasoning behind engineering decisions rather than a scattered list of APIs. The translator, Huang Jianhong, is himself the author of Redis Design and Implementation and a well-known Redis advocate in China; his terminology is accurate, his annotations are thoughtful, and the Chinese sample code is organized on a companion site, so it does not read like a translation. The 11 chapters in three parts are clearly structured: on a first pass you can follow only the cases in Parts One and Two, and turn to Part Three when you hit performance problems, making it well suited as a book to keep at hand for reference. One caveat: the book was written against Redis 2, and Redis has since moved to 7.x, so newer features such as Cluster and Stream are not covered. But the fundamentals—the five data structures, persistence and replication, distributed locks and queues—have barely changed, and the book's thinking still holds today. It is best treated as a conceptual textbook for understanding what Redis can do and how it should be done, supplemented with the official documentation for version updates, for the most efficient learning.

Editor's review

很多 Redis 书只教命令,这本教的是“用法”。作者 Josiah L. Carlson 常年活跃于 Redis 邮件列表与开源社区,书中每一个知识点几乎都落在一个能跑起来的真实项目上:从文章投票、购物车、网页缓存这样的小功能,一路搭到分布式锁、信号量、任务队列、广告定向和社交网站,最后再讲内存压缩、分片扩展与 Lua 脚本。这种“先写出来、再优化、再扩展”的推进方式,让读者看见的是工程决策的来龙去脉,而不是零散 API 的罗列。 译者黄健宏本身就是《Redis设计与实现》的作者、国内知名的 Redis 布道者,译文术语准确、注解用心,中文示例代码也整理在配套站点上,读起来不像在读译稿。全书 11 章三部分结构清晰,第一次通读可以只跟第一、二部分的案例,遇到性能问题再翻第三部分,很适合作为随手查阅的手边书。 需要说明的是,本书基于 Redis 2 版本写作,如今 Redis 已迭代到 7.x,集群、Stream 等新特性不在覆盖范围内。但五种数据结构、持久化与复制、分布式锁与队列这些基本盘几乎未变,书中的思路今天依然成立。建议把它当作“理解 Redis 能干什么、该这么干”的思维教科书,再配合官方文档补上版本更新,学习效率最高。

Who it's for

A good fit for

  • 已掌握一门后端语言(Python、Java、Go 等),想系统学习 Redis 的开发者
  • 需要给网站加缓存、会话、排行榜、消息队列等功能的 Web 后端工程师
  • 准备面试、希望理清 Redis 数据结构与分布式用法的大学生和转行者
  • 做系统架构或运维,想了解 Redis 持久化、复制与内存优化的技术人员

Not a good fit for

  • 完全零编程基础、只想看概念科普的纯新手
  • 专门寻找 Redis Cluster、Stream、Redis 7 新特性等最新版本内容的读者
  • 只想查命令参数、把它当纯命令手册翻查的读者

Reading tips

  1. 先读第 1—2 章,边读边在本机装好 Redis,把文章投票与购物车的代码跑通再做笔记。
  2. 第 3—8 章按“先自己实现、再看书上方案”的顺序练习,重点体会分布式锁与任务队列的坑。
  3. 第三部分可先选读第 9 章与第 11 章,第 10 章留到真正遇到容量瓶颈时再细读。
  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. Part One: Getting Started
  2. Chapter 1: Getting to Know Redis
  3. 1.1 An Introduction to Redis
  4. 1.2 An Introduction to Redis Data Structures
  5. 1.3 Hello Redis
  6. 1.4 Getting Help
  7. 1.5 Summary
  8. Chapter 2: Building a Web Application with Redis
  9. 2.1 Login and Cookie Caching
  10. 2.2 Shopping Carts in Redis
  11. 2.3 Web Page Caching
  12. 2.4 Data Row Caching
  13. 2.5 Web Analytics
  14. 2.6 Summary
  15. Part Two: Core Concepts
  16. Chapter 3: Redis Commands
  17. Chapter 4: Data Safety and Performance
  18. Chapter 5: Building Support Programs with Redis
  19. Chapter 6: Building Application Components with Redis
  20. Chapter 7: Search-Based Applications
  21. Chapter 8: Building a Simple Social Network
  22. Part Three: Advanced Topics
  23. Chapter 9: Reducing Memory Usage
  24. Chapter 10: Scaling Redis
  25. Chapter 11: Lua Scripting in Redis
  26. Appendix A: A Quick Installation Guide

FAQ

这本书适合零基础直接学吗?
不太适合。书中示例多用 Python 编写并默认读者懂基本编程和 HTTP 概念,建议先具备一门后端语言基础、了解基本的 Web 请求流程,再读会顺畅很多。
书里的内容现在过时了吗?
本书基于 Redis 2 编写,缺少 Cluster、Stream 等新特性,部分命令参数也有变化。但数据结构、持久化、复制、分布式锁、队列、Lua 脚本等核心内容基本仍然适用,作为入门与思维训练依然有价值,细节请以官方文档为准。
这本书和《Redis设计与实现》有什么区别?
《Redis设计与实现》重在讲 Redis 内部数据结构与源码实现;《Redis实战》重在讲如何在业务中用 Redis 解决问题。两本书译者都是黄健宏,可以先用本书学会用,再读前者理解原理。
读这本书需要准备什么环境?
书末附录给出了在 Debian/Ubuntu、OS X 和 Windows 下安装 Redis 与 Python 的步骤,准备好一台能装 Redis 的机器和 Python 环境即可,示例代码可在配套中文站点获取。

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