DyanmoDB is a popular service of AWS used by multiple companies worldwide and it has the huge advantage of delivering consistent single-digit millisecond responses, even with thousands or millions of requests per second!
There are not many other services online that are as performant, but AWS thought this was not enough, and last year they announced DynamoDB Accelerator (DAX). With DAX they claim the response time to go down from milliseconds to microseconds, which if you know a bit about databases and the speed of disk/ram/network, it’s a huge achievement!
How could they manage to reduce an order of magnitude the performance? This is what this article is about.
The concept is not too complex. They built an in-memory cache in front of DyanmoDB (that you can decide if to enable or not) so that instead of building and maintaining your own caching infrastructure, they can handle it for you completely as a service and without changing any single line of code, just pointing to a different DynamoDB hostname.
Considering how much work there is behind maintaining a large cache infrastructure, this looks like magic. Unfortunately, it is only for DynamoDB, because that has some advantages in terms of cache invalidation, but I think in the future this may be built also for other SQL databases. Who knows, maybe AWS is already thinking about building something like this on top of Aurora (their SQL managed service), and we don’t need to build and maintain our own separate caches for each of our databases and don’t need to change the code anymore to reduce of orders of magnitude our database performance.