48

We're using AWS, and considering to use DynamoDB or Redis on our new service.
Below is our service's character

  1. Insert/Delete occur over between hundreds and thousands per minute, and will be larger later.
  2. We don't need quick search, only need to find a value with key
  3. Data should not be lost.
  4. There are another data that doesn't have a lot of Insert/Delete unlike 1.

I'm worried about when Redis server down.
When the Redis failure, our data will be removed.

That's why I'm considering to select Amazon DynamoDB.
Because DynamoDB is NoSQL, so Insert/Delete is so fast(slower than Redis, but we don't need to that much speed), and store data permanently.

But I'm not sure that my thinking is right or not.

If I'm thinking wrong or don't think another important point, I'm going appreciate when you guys teach me.

Thanks.

JoonT
  • 1,106
  • 1
  • 13
  • 29
  • What kind of data are you considering to store ? – Ankit Deshpande Jul 03 '19 at 12:54
  • Path information. all row's schema is same. Don't need to different between each rows. – JoonT Jul 03 '19 at 16:12
  • https://stackoverflow.com/questions/5400163/when-to-redis-when-to-mongodb?rq=1 I think this answer is quite similar to what you are looking for. You can enable backups for redis to save data on disk. – Ankit Deshpande Jul 05 '19 at 10:02
  • 1
    Redis Cloud Pro from Redis Labs might give you the right solution Redis with high availability and durability, , see https://redislabs.com/redis-enterprise/pro/ – Guy Korland Jul 10 '19 at 19:26

1 Answers1

64

There are two type of Redis deployment in AWS ElastiCache service:

  1. Standalone
  2. 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/

Roman Shishkin
  • 2,097
  • 20
  • 21
  • 1
    DAX is nice, but it supports AWS SDK 1.x only, no support for AWS SDK 2.x, – Boris Bolshem Aug 20 '21 at 17:47
  • 10
    Earlier versions of Redis lacked durability . AWS MemoryDB offers durability with same performance as Redis. MemoryDB is closer to what DynamoDB offers. AWS MemoryDb is built on top of Redis Engine. https://aws.amazon.com/memorydb/ – aked Oct 22 '21 at 01:11
  • DAX is supported on 2.x now. AWS MemoryDB offers the advantages mentioned but at a noticeably higher price than its ElastiCache equivalent for the same memory capacity. – Miles Elam Jul 10 '22 at 04:53
  • For write heavy applications that need consistency, DynamoDB had some things to be aware of. DAX cannot be used for transactions or consistent reads. This presents a problem when you must read and write to one partition very often (there are partition level limits that cannot be scaled out of). With Redis, synchronous replication with `WAIT` command greatly improves durability when primary nodes are lost. MemoryDB you must pay per GB written, where in Redis you do not, but the durability guarantees are different. – jocull Nov 19 '22 at 21:36