We're using AWS, and considering to use DynamoDB
or Redis
on our new service.
Below is our service's character
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.
Redis works faster than other caching solutions. Rich data structures. Redis offers five possible data options for the values. These are hashes, lists, sets, strings, and sorted sets.
DynamoDB and Redis are fast, robust, and reliable NoSQL databases. They both use the key-value store as the primary database model, and DynamoDB also supports the document model. Redis offers secondary database models like the document store, graph DBMS, and spatial DBMS.
DynamoDB caching can significantly increase performance even if the number of requests exceeds millions of requests per second.
The main reason we use Elasticache rather than DynamoDB is the speed - you get sub 1ms round trip latency for small objects. The box is really close to your EC2 machine, and memory is that much faster than disk, even SSD.
There are two type of Redis deployment in AWS ElastiCache service:
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With