Put the application in charge of freshness
How cache-aside and write-through patterns, invalidation, and TTLs control freshness when applications reuse cached database results. · advanced
Query caching reuses database results rather than executing the same query on every read. It suits frequently accessed, relatively static data, especially expensive non-indexed lookups, aggregations, and joins. Under high read concurrency, reuse reduces database CPU pressure and improves throughput.
The trade-off is potentially stale data: a stored result does not prove that the database still contains the same values. Decide whether the application can tolerate that difference before deciding how to cache.
This design uses an application on Amazon EC2, an ElastiCache in-memory result cache, and an authoritative relational database on Amazon RDS. These roles differ from Amazon CloudFront's HTTP content delivery and Amazon DynamoDB's nonrelational database role.
1 / 6 The application owns the policy for reusing database results and deciding when to fetch them again.
AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.