I’m building a side project which relies on several realtime features. Since I need a very fast database, I decided on using Redis. I had started learning about Elasticache a few days ago for this purpose but recently AWS launched MemoryDB.
I’m not too sure about how it differs from Elasticache and which one I should use. I’d be grateful if someone could help me with this. I’m specially interested in the pricing differences, management and scalability.
realtime and realtime are different things. guaranteed time to return is really hard vs. returns usually in x time. highly recommend to document down what kind of realtime you are talking. difference between those is calculate in zeroes added into final bill, also hard realtime multiplies it even more.
If you are just talking realtime in usually in a second to client then database with some frontend cache if possible is probable cheapest way if data is shared between clients.
I wrote an application a few years back that used Redis as its primary data store (technically Elasticache, but that’s not a word I use much, because it was just Redis). Redis is fine as a cache, but it’s so much more than that. I needed really robust set and sorted set functionality, fast intersections and diffs, etc. Of course, I was concerned about losing that in-data memory, which is why I also stored the data in S3. I also didn’t need ALL the data in memory at once, so I had a freeze/thaw thing going, with automatic expiration of Redis data that hadn’t been “touched” in a certain number of minutes.
So, having done all that, MemoryDB caught my attention. But I don’t think I would pay those prices for it. I would just rig up something similar using S3. I was really pleased with how fast I was able to “thaw” a set of data from S3. And that storage is so cheap. It really felt like an unlimited database, because once it was fine-tuned, it essentially was.
I think the ROI only works if you plan to use it as the primary DB. Killing an Aurora or RDS database + Elasticache vs Memory DB you will have a reduced cost for Memory DB as well as fewer things to manage. But as a caching layer, it is way too expensive.
Yeah, and I cringe every time people refer to Redis as “a cache,” because it does so many amazing things. Sure, caching is important, and Redis does that well also. But it’s so much more.
. It compares performance of ElastiCache and MemoryDB, among other things.
As others have mentioned, use ElastiCache to speed things up when you already have another data store that provides data durability guarantees. Use MemoryDB when you want ultra fast (sub millisecond) reads and you don’t want to manage separate durable and caching data stores. Write speeds are comparable to durable stores like DynamoDB.
I think the concerns Corey Quinn had in his podcast are quite nitpicky to be honest. Who cares if spinning up a cluster takes 15 minutes? You’re only doing it once. Also, region availability has improved significantly since initial launch.
I’m seeing people using Elasticache in front of DynamoDB. (example)
Given that DynamoDB lookups are already single digit millisecond, isn’t this overkill for most applications? Or is Elasticache being used for sub-millisecond latency?
I have no idea why you’d want to put a cache in front of dynamodb. We ourselves actually use dynamo itself sometimes as a fast cache. I’m sure there’s a use case but I’m not aware of it.