售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Redis Essentials
Table of Contents
Redis Essentials
Credits
About the Authors
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started (The Baby Steps)
Installation
Installing from source
Hello Redis (command-line interface examples)
Installing Node.js
JavaScript syntax quick reference guide
Hello World with Node.js and Redis
Redis data types
Strings
String examples with redis-cli
Building a voting system with Strings using Node.js
Lists
List examples with redis-cli
Implementing a generic Queue System
Hashes
Using Hashes with redis-cli
A voting system with Hashes and Node.js
Summary
2. Advanced Data Types (Earning a Black Belt)
Sets
Set examples with redis-cli
Building a deal tracking system
Sorted Sets
Sorted Set examples with redis-cli
Building a leaderboard system for an online game
Bitmaps
Bitmap examples with redis-cli
Building web analytics
HyperLogLogs
Counting unique users – HyperLogLog versus Set
HyperLogLogs examples with redis-cli
Counting and retrieving unique website visits
Summary
3. Time Series (A Collection of Observations)
Building the foundation
Optimizing with Hashes
Adding uniqueness with Sorted Sets and HyperLogLog
Summary
4. Commands (Where the Wild Things Are)
Pub/Sub
Transactions
Pipelines
Scripting
Lua syntax basics
Redis meets Lua
Miscellaneous commands
INFO
DBSIZE
DEBUG SEGFAULT
MONITOR
CLIENT LIST and CLIENT SET NAME
CLIENT KILL
FLUSHALL
RANDOMKEY
EXPIRE and EXPIREAT
TTL and PTTL
PERSIST
SETEX
DEL
EXISTS
PING
MIGRATE
SELECT
AUTH
SCRIPT KILL
SHUTDOWN
OBJECT ENCODING
Data type optimizations
String
List
Set
Hash
Sorted Set
Measuring memory usage
Summary
5. Clients for Your Favorite Language (Become a Redis Polyglot)
PHP
The basic commands in PHP
The blocking commands in PHP
Pipelines in PHP
Transactions in PHP
Scripting in PHP
Python
The basic commands in Python
The blocking commands in Python
Pipelines in Python
Transactions in Python
Scripting in Python
Ruby
The basic commands in Ruby
The blocking commands in Ruby
Pipelines in Ruby
Transactions in Ruby
Scripting in Ruby
Summary
6. Common Pitfalls (Avoiding Traps)
The wrong data type for the job
The Set approach
The Bitmap approach
Multiple Redis databases
Keys without a namespace
Using Swap
Not planning and configuring the memory properly
An inappropriate persistence strategy
Summary
7. Security Techniques (Guard Your Data)
The basic security
Obfuscating critical commands
Networking security
Protecting Redis with firewall rules
Running Redis on the loopback network interface
Running Redis in a Virtual Private Cloud
Encrypting client-to-server communication
Running stunnel on both the server and the client
Running stunnel on the server and using a Redis client that supports SSL
Summary
8. Scaling Redis (Beyond a Single Instance)
Persistence
RDB (Redis Database)
AOF (Append-only File)
RDB versus AOF
Replication
Partitioning
Range partitioning
Hash partitioning
Presharding
Consistent hashing
Tagging
Data store versus cache
Implementations of Redis partitioning
Automatic sharding with twemproxy
Other architectures that use twemproxy
Summary
9. Redis Cluster and Redis Sentinel (Collective Intelligence)
The CAP theorem
Redis Sentinel
The basic Sentinel configuration
Connecting to Sentinel
Network partition (split-brain)
Redis Cluster
Hash slots
Hash tags
Creating a basic cluster
Finding nodes and redirects
Configuration
Different Redis Cluster architectures
Cluster administration
Creating a cluster
Adding slaves/replicas
Scaling reads using slave nodes
Adding nodes
Removing nodes
Redis Cluster administration using the redis-trib tool
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜