There are two type of Redis deployment in AWS ElastiCache service:
- Standalone
- Multi-AZ cluster
With standalone installation it is possible to turn on persistence for a Redis instance, so service can recover data after reboot. But in some cases, like underlying hardware degradation, AWS can migrate Redis to another instance and lose persistent log.
In Multi-AZ cluster installation it is not possible to enable persistence, only replication is occur. In case of failure it takes a time to promote replica to master state. Another way is to use master and slave endpoints in the application directly, which is complicated. In case of failure which cause a restart both Redis node at time it is possible to lose all data of the cluster configuration too.
So, in general, Redis doesn't provide high durability of the data, while gives you very good performance.
DynamoDB is highly available and durable storage of you data. Internally it replicates data into several availability zones, so it is highly available by default. It is also fully managed AWS service, so you don't need to care about Clusters, Nodes, Monitoring ... etc, which is considering as a right cloud way.
Dynamo DB is charging by R/W operation (on-demand or reserved capacity model) and amount of stored data. In may be really cheap for testing of the service, but much more expensive under the heavy load. You should carefully analyze you workload and calculate total service costs.
As for performance: DynamoDB is a SSD Database comparing to Redis in-memory store, but it is possible to use DAX - in-memory cache read replica for DynamoDB as accelerator on heavy load. So you won't be strictly limited with the DynamoDB performance.
Here is the link to DynamoDB pricing calculator which one of the most complicated part of service usage: https://aws.amazon.com/dynamodb/pricing/
Answer from Roman Shishkin on Stack Overflowredis vs memchache vs elasticache vs dynamodb
amazon web services - DynamoDB vs Redis for persistent storage? - Stack Overflow
aws redis vs dynamodb vs rds
Should I use dynamoDB or Redis Elasticache for user sessions?
Can someone ELI5 the differences? Very confused particularly with whata redis / memcached / elasticache are, and how they fit in :\
Why does aws have hundreds of servics all thata do very similar stuff
I can't get a definitive answer to this via googling.
connect-redis has 422,142 weekly downloads whereas connect-dynamodb only has 8,594, indicating the Redis option is far more popular.
Can I ask which is the best solution and why? Thanks.