Can MemoryDB handle high write throughput for balance updates?
Asked by
6th.sense
I'm currently using DynamoDB for my project, but I'm hitting a limitation. There's a per-partition limit of 1000 writes per second in DynamoDB, and a small percentage of my customers need to perform balance updates that exceed this limit. I've heard that MemoryDB is like a persistent version of Redis. Is it a good choice for handling these high-throughput balance updates?
Answers
Keep in mind that the 1k TPS limit you're facing is specific to partitions in DynamoDB. Each partition can only handle a fixed set of keys. So while bucket hashing can help, you'll need to shard your primary key and perform separate GET operations for each shard to really scale effectively.
Reply to this answer
One option you could explore is deepening your hash key, like using a structure such as partner:subaccount. This could help you create more partitions, which might improve your write performance. Just be sure you're not trying to overdo it on a single row.
Reply to this answer
You might also consider breaking your counter into several buckets with DynamoDB's bucket hashed counters. When you increment the counter, you distribute the writes across different buckets, which helps with scaling. You can then sum the values from all buckets when you need the current count. There are quite a few resources out there that discuss this type of implementation!
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions