This article gives you a detailed guide on how to plan your cache instance.
Before creating a cache, it's crucial for businesses to evaluate several important metrics. These metrics will help in planning the cache's scale.
The memory capacity required by the business cache is the most important reference metric. Based on the capacity, you can initially decide on the cache architecture model and the size of resources needed, which indirectly influences the business's cost.
QPS refers to the number of requests per second to Redis. This metric directly affects business performance and latency. Comparing the business's request volume with the cache benchmark QPS can also help determine the cache architecture and the resources to be requested. The benchmark cache QPS is 100,000/sec.
The number of connections refers to the number of client connections to the Redis cache per second. This metric directly impacts the connectivity between the business and the cache. Depending on the number of client connections, it's necessary to set a reasonable maximum connection limit for the cache. You can also adjust the number of clients.
At the initial stage of cache planning, memory capacity needs to be determined first. Cache memory usage mainly includes the space occupied by actual stored key/value pairs and fragmentation. At the system level, it also includes space occupied by some system processes and memory fragmentation at the operating system level.
For example, with a virtual machine having 100GB of memory capacity, it is usually recommended that the cache uses 80% of the virtual machine's memory.
Calculating the Redis storage memory space required by the business involves the following steps:
For example, if the estimated data volume over the next year is 500GB, adding 10% cache overhead and reserving 20% buffer space, the total Redis memory requirement is:
500GBĂ—(1+30%)=650GB
This calculation helps businesses reasonably plan Redis storage needs, allowing sufficient memory space for business development. Continuous monitoring and adjustment based on actual conditions are also required.
Based on different business scenarios, storage capacity, QPS, and the number of connections, plan the cache architecture model.
Types of Cache Architecture Models:
Currently, Montplex Cache supports a maximum memory capacity of 4GB for a single shard. It is nearly 100% compatible with Redis.
MontCache Cloud currently supports unlimited memory capacity for multiple shards. Each shard has a maximum memory capacity of 4GB. It is nearly 100% compatible with open-source Redis Cluster.
Planning Redis cache disaster recovery across availability zones involves the following steps:
By reasonably planning Cache disaster recovery across availability zones, you can enhance the availability and data security of critical businesses, ensuring quick recovery in case of failures. Montplex can provide professional consultation and solutions to help you build a highly available Cache architecture.