The Big Why
You may ask, why should I use Redis? I have been working with Memory Cache and Relational Databases, and so far I am still OK. Right?I am staring at the picture above, and asking myself the exact question: why are people still using such a phone?
- It is traditional, and some people like it
- The decoration surrounding the phone match the style
- It is a no-frill phone, but with great rotary dial and oh, that handset!
- More choices of ring tones
- You can take it with you to other rooms
- Ability to store your contact book and even receive emails!
- Caching large amount of data
- Needs caching to be highly available and be consistent with all servers in the cluster
- Relational database queries are too slow for your requirement
- You want to try something new
SDL Web 8.5 and Redis
Binary Storage (Redis as Database)
The introduction of Scalable Deployer in Web 8.5 is removing yet another bottleneck. The new "Deployer" is simply responsible for pushing Deployer Packages into the Binary Storage. A new concept "Deployer Worker" is replacing the traditional Deployer to pick these binaries from the Binary Storage, and push items into Broker Database.The Binary Storage can be either File System or Redis based. If you have the requirement to scale Deployer or Deployer Workers into multiple machines, or you need to have fail-over requirements of the Binary Storage, Redis to be rescue.
The Deployer and Deployer Worker configurations are very simple. Each service has a configuration file "deployer-conf.xml", that has a section to configure Binary Storage location.
For the full explanation of Deployer, Deployer worker and Binary Storage configurations, please refer to Richard Hamlyn's Quick Start Guide
Client-side Caching (Redis as Cache)
Redis Client Tools
Command Line Tool - redis-cli
Desktop Tool - Redis Desktop
Web-based Tool - Redsmin
Plug-in of other Performance Tool - Redis for New Relic
It is time to try
- Install Redis Service, listening on localhost:6379
- Use redis-cli to test and insert a new key-value pair
- Install Redis Desktop and connect to localhost:6379
- Configure your DXA web application to use Redis Cache
- Load a DXA page, and check if and how things are cached.