Redis usage for Application Cache
ObjectiveTo cache user based API/service response that can enable to provide a much faster response time to server from in memory compare to any other data source. Highly scalable data store shared by multiple processes, multiple applications, or multiple servers.
TechStack – Redis version: 3.2 and Java
Scope
- Cache any API/service response in Redis (in memory)
- To enable any API/service to get/set cache value from Redis
- Implement the caching on key value pair
- Persistent mechanism supported are AOF (Append Only File), Point in Time or Snapshotting (RDB file) AND Only in Cache.
- Replication can be configured as master/slave where master can be used to write and all slaves can use to read. A master can have multiple slaves. Slaves are able to accept other slave’s connections. If you set up a slave, upon connection it sends a SYNC command and it doesn't matter if it's the first time it has connected or if it's a reconnection.
- Following data types are supported by Redis data model:
- Strings (key-value pair)
- List of strings
- Sets of strings
- Sorted sets of strings
- Hashes - where keys and values are strings
The value can consist content, etag, created time, modified time and TTL etc.
SET- 122556.53 requests per second To 552028.75 requests per second
- 58.50% <= 0 milliseconds
- 99.17% <= 1 milliseconds
- 99.58% <= 2 milliseconds
- 99.85% <= 3 milliseconds
- 99.90% <= 6 milliseconds
- 100.00% <= 9 milliseconds
- 114293.71 requests per second
- 123601.76 to 707463.75 requests per second
- 43.12% <= 0 milliseconds
- 96.82% <= 1 milliseconds
- 98.62% <= 2 milliseconds
- 100.00% <= 3 milliseconds
- 81234.77 requests per second