Search code examples
amazon-web-servicesamazon-dynamodbamazon-dynamodb-dax

What's the difference between DAX and CloudFront?


Can anybody simply summarize why/when I would use one over the other?


Solution

  • CloudFront is AWS's CDN, or content delivery network. It's a collection of over 200 server deployments all over the world (called edges or PoPs) that all advertise the same URL / IP address range. When you have data that never or rarely changes, you can host it somewhere and serve it through a CloudFront URL - each of these edges will cache a copy of the data and serve it very quickly on subsequent requests. Since you now have hundreds of servers all over the world on your side, the amount of data you can serve and the speed to you can serve it at increases by many orders of magnitude. You'll use CloudFront by giving your end users CloudFront URLs that they hit directly.

    DAX is a caching layer that's specifically tied to AWS's DynamoDB database, which is key-value & range query storage structure. DAX sits in front of DynamoDB, storing frequently used keys and values in memory, which allows it to serve them back to you quickly without actually hitting DynamoDB. Any write that happens also automatically clears the cache for that key. This is local to particular region and DynamoDB database. You'll use DAX by installing a special client SDK in your server code that can understand the special protocol, and pass all DynamoDB reads and writes through it.