Operational DBs

icon picker
Amazon ElastiCache

Amazon ElastiCache is a fully managed in-memory data store and cache service that supports two popular open-source caching engines, Redis and Memcached. It is designed to improve the performance of web applications by enabling you to retrieve information from fast, managed, in-memory caches instead of relying entirely on slower disk-based databases. It’s a key/value store.
image.png

Key Features:

In-Memory Caching:
Significantly improves latency and throughput for read-heavy and compute-intensive application workloads.
Best suited for Online Analytics Processing (OLAP) transactions.
Supported Engines:
Redis: Offers advanced data structures, replication, persistence, and clustering.
Memcached: A simpler, multi-threaded caching solution ideal for large, horizontal scaling.
Scalability and Flexibility:
Push-button scalability for memory, writes, and reads.
Nodes can be easily added or removed to meet demand.
High Availability and Reliability:
Nodes are automatically replaced in case of failure.
Redis supports master/slave replication, automatic failover, and cross-AZ high availability.
Security and Control:
Access controlled via VPC security groups and subnet groups.
Nodes are not accessible from the Internet or across different VPCs.
Supports encryption in transit and at rest (for Redis).
Cost-Effective:
Billed based on node size and hours of use.
Options for on-demand or reserved instances (but not Spot instances).
Integration and Management:
Fully integrated with other AWS services.
Simplified management through the AWS Management Console, CLI, SDKs, and APIs.
Maintenance windows for software patching.

Use Cases:

Session Store: Store session data for web applications to provide a fast and reliable user experience.
Database Query Caching: Cache the results of frequently executed database queries to reduce database load and improve response times.
Computational Caching: Cache the results of computationally intensive operations to save resources and reduce processing times.
Leaderboards/Counting: Use Redis for storing real-time leaderboards and counters due to its advanced data structures.
Streaming Data: Utilize Redis for real-time data processing and analytics, leveraging its support for streams and other data types.
use cases of elasticache
Column 1
Column 2
Use Case
Benefit
Web session store
In cases with load-balanced web servers, store web session information in Redis so if a server is lost, the session info is not lost, and another web server can pick it up
Database caching
Use Memcached in front of AWS RDS to cache popular queries to offload work from RDS and return results faster to users
Leaderboards
Use Redis to provide a live leaderboard for millions of users of your mobile app
Streaming data dashboards
Provide a landing spot for streaming sensor data on the factory floor, providing live real-time dashboard displays
There are no rows in this table

ElastiCache Architecture:

Nodes:
The smallest building block, each node is a fixed-size chunk of secure, network-attached RAM.
Runs an instance of either Memcached or Redis.
Each node has its own DNS name and port.
Clusters:
A collection of one or more nodes using the same caching engine.
Nodes within a cluster can span multiple subnets of the same subnet group.
Subnet Groups:
A collection of subnets designated for your ElastiCache clusters within a VPC.
Required for deploying ElastiCache in a VPC.
Endpoints:
Unique addresses used by applications to connect to ElastiCache nodes or clusters.

Maintenance and Updates:

Maintenance windows can be defined to allow software patching to occur.
ElastiCache automatically applies updates during these windows to ensure minimal disruption.

Engine Differences:

Memcached:
Simpler model with support for large nodes and multiple cores/threads.
Can easily scale in and out.
Ideal for caching objects and DB results.
Redis:
More complex model with support for encryption, replication, high availability, and backup/restore.
Supports advanced data structures, such as sorted sets and hashes.
Can be configured for cross-AZ replication and automatic failover.

image.png

Exam tip: the key use cases for ElastiCache are offloading reads from a database and storing the results of computations and session state. Also, remember that ElastiCache is an in-memory database and it’s a managed service (so you can’t run it on EC2).



Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.