0

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

Sudhir Jonathan
  • 16,998
  • 13
  • 66
  • 90
  • CloudFront is simply a layer on the front end of the pipe. It can cache static content and in conjunction with say, api gateway caching, can cache data from a backend service for a finite period to improve performance. DynamoDB and the accelerator service is still backend service and has to be called via a middleware, however, dax leverages a cache service so frequently accessed data can be obtained in more timely manner from DynamodDB database calls. – Ross Bush Aug 05 '22 at 01:33
  • 1
    Ross explained well but I want to note that these can be used in conjunction with each other, it does not need to be one or the other – jordanm Aug 05 '22 at 01:37

1 Answers1

3

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.

Sudhir Jonathan
  • 16,998
  • 13
  • 66
  • 90