Cover
Copyright
Credits
About the Author
About the Reviewers
www.PacktPub.com
Table of Contents
Preface
Chapter 1: Introduction to NoSQL
An Internet-enabled world
The NoSQL primer
Graph-oriented NoSQL
Document-oriented NoSQL
Salient features of MongoDB and CouchDB
Column-oriented NoSQL
Salient features of HBase and Cassandra
Key value-oriented NoSQL
How does Redis fare in some of the nonfunctional requirements as a key-value datastore?
Use cases of NoSQL
Summary
Chapter 2: Getting Started with Redis
Installing Redis on Windows
Installing Redis on Mac OS
Introduction to redis.conf
Hello World in Redis
Hello World using redis-cli
Hello World using Java
Installing Jedis and creating an environment
Writing the program
Shutting down the server
Load a test Hello World program in Redis
Summary
Chapter 3: Data Structures and Communicating Protocol
in Redis
Data structures
Data types in Redis
The string data type
The BitSet or bitmap data type
Use case scenario
The Hashes data type
Use case scenario
Data type: lists
Use case scenario
The Sets data type
Use case scenario
Data type: Sorted Sets
Use case scenario
Communication protocol: RESP
Summary
Chapter 4: Functions in Redis Server
Real time messaging (PUB/SUB)
Pipeline in Redis
Transactions in Redis
Pipeline versus transaction
Pipeline and Transaction
Scripting in Redis
Brief introduction on Lua
Use case: reliable messaging
Connection management
Redis authentication
Redis SELECT
Redis ECHO and PING
Summary
Chapter 5: Handling Data in Redis
Classifying data
Master-slave data replication
Setting master and slave nodes
Performance pattern: high reads
Performance pattern: high writes
Persistence handling in Redis
Persisting via RDB option
Configuring Redis for RDB persistence
Use case for using RDB persistence
Persisting via AOF option
Configuring Redis for AOF persistence
Use case for using AOF persistence
Dataset handling commands in Redis
Summary
Chapter 6: Redis in Web Applications
Simple e-commerce: Redis backed e-commerce site
Session management
Catalogue management
Online analytics
Implementation: Simple E-Commerce
ProductApp
UserApp
RedisDBManager
ProductDBManager
AnalyticsDBManager
ShoppingCartDBManager
UserCartDBManager
Summary
Chapter 7: Redis in Business Applications
Configuration management
Gossip server
Node
Layered design
Listeners
The data handler layer
Client node commands
The register command
Implementation of RegisterCommand
Implementation of RegisterCommandHandler
The activate command
Implementation of ActivateCommand
Implementation of ActivateCommandHandler
The set command
Implementation of SetCommand
Implementation of SetCommandHandler
The get command
Implementation of GetCommand
Implementation of GetCommandHandler
The del command
Implementation of DeleteCommand
Implementation of DeleteCommandHandler
The status command
Implementation of StatusCommand
Implementation of StatusCommandHandler
The passivate command
Implementation of PassivateCommand
Implementation of PassivateCommandHandler
The reactivate command
Implementation of ReactivateCommand
Implementation of ReactivateCommandHandler
The archive command
Implementation of ArchiveCommand
Implementation of ArchiveCommandHandler
The sync command
Implementation of SyncCommand
Implementation of SyncCommandHandler
The reconnect command
Implementation of ReconnectCommand
Implementation of ReconnectCommandHandler
Master node commands
The start command
Implementation of StartMasterCommand
The stop command
Implementation of StopMasterCommand
The status command
Implementation of StatusCommand
Implementation of StatusCommandHandler
The get command
Implementation of GetNodeDataCommand
Implementation of GetNodeDataCommandHandler
The msg command
Implementation of MessageCommand
Implementation of MessageCommandHandler
The kill command
Implementation of KillNodeCommand
Implementation of KillNodeCommandHandler
The clone command
Implementation of CloneNodeCommand
Implementation of CloneNodeCommandHandler
Redis config: data management
The RDB option
AOF option
VM overcommit memory
Summary
Chapter 8: Clustering
Clusters
Cluster pattern: master-master
Performance
Availability
Scalability
Manageability
Security
Drawbacks of this pattern
Sharding
Observations
Cluster pattern: master-slave
Performance
Availability
Scalability
Manageability
Security
Drawbacks of this pattern
Configuring Redis Sentinel
Summary
Chapter 9: Maintaining Redis
Maintaining ephemeral data
Maintaining nonephemeral data
Redis 2.4
Redis 2.6 to 2.8
Dump and restore
Snapshotting
Redis 3.0
Summary
Index