AWS Elasticache redis 安全和限制

AWS Elasticache redis secure and limitation

我正在使用 AWS Elasticache Redis 存储 AWS Lambda 的用户会话。

  1. 超过1000个用户使用Elasticache在内存(Redis)中存储键值对,并为所有这些键设置过期时间是否合适?
  2. 在Redis中存储密钥有什么限制吗?

回答问题(1):

如果您的实例有足够的 RAM 来存储数据(我假设它有),那么没问题。 Redis 旨在用于将数据存储在内存中(可以刷新到磁盘)。

我已经在生产中使用了数百万个密钥,没有出现问题。

回答问题(2):

What is the maximum number of keys a single Redis instance can hold? and what the max number of elements in a Hash, List, Set, Sorted Set?

Redis can handle up to 232 keys, and was tested in practice to handle at least 250 million keys per instance.

Every hash, list, set, and sorted set, can hold 232 elements.

In other words your limit is likely the available memory in your system.

https://redis.io/topics/faq