From 0bffde6d94c4148538fbf9d82076bd57e7394c6a Mon Sep 17 00:00:00 2001 From: JJ Date: Tue, 8 Apr 2025 17:58:14 +0100 Subject: first commit --- .../aws-solutions-architect/elasticache.md | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/certifications/aws-solutions-architect/elasticache.md (limited to 'src/certifications/aws-solutions-architect/elasticache.md') diff --git a/src/certifications/aws-solutions-architect/elasticache.md b/src/certifications/aws-solutions-architect/elasticache.md new file mode 100644 index 0000000..a17626b --- /dev/null +++ b/src/certifications/aws-solutions-architect/elasticache.md @@ -0,0 +1,53 @@ +# ElastiCache + +## Overview + +ElastiCache is Amazon's offering for managed Redis or Memcached. + +Caches are in-memory dbs with high perf and low latency. They allow quick access to data without having to reach the DB disk. + +This helps: + +- Latency +- Reduce load on DB resources +- Makes application stateless + +> AWS will take care of maintenance, patching, optimisations, monitoring, failure etc for you + +## Architecture + +Apps query the cache, but if it misses, then it will read from DB. + +Caches should have an invalidation strategy + +![cache architecture](assets/elasticache.png) + +## Use session store + +Another good use case is for a session store for a user's session: + +![cache architecture](assets/session-store.png) + +## Elasticcache security + +- ElastiCache support IAM Auth for Redis +- IAM is only used for API level access, though +- There is also Redis auth, which allows you to create a user/pw combination for Redis cluster and is an extra layer of security +- Memcached supports SASL based auth + +## ElastiCache patterns + +1. **LazyLoading**: this involves writing all data to cache for quick access. Data can quickly become stale. +1. **Write Throgh**: When data is written to the the db, also write to cache +1. **Session store**: Store temporary data in cache (such as session info) + +## Redis use case + +> Important for the exam + +- Gaming leaderboards are computationally complex +- **Redis sorted sets** guarantees uniqueness and element ordering +- Each time an element is added, it's ranked in realtime, then added in correct order: + + +![](assets/redis-sorted-sets.png) -- cgit v1.2.3