ladderlore
请求新指南
  • 输入服务名称,例如 S3 或 IAM。

服务 · Database · 基于 CLF-C02

Amazon ElastiCache

In-memory cache. Choose Valkey or Redis OSS for rich features, Memcached for a simple multithreaded cache.

本课尚未翻译,暂以英文显示。

你在云从业者中已学过

  • ElastiCache answers in microseconds and takes read load off a database.
  • Engines are Valkey, Redis OSS and Memcached.
  • A cache keeps copies. The database still holds the main data.
阅读云从业者课程
  • Data types

    Valkey or Redis OSS
    Lists, sets, sorted sets, hashes
    Memcached
    Simple strings and objects
  • Replication

    Valkey or Redis OSS
    Replicas, automatic failover
    Memcached
    None
  • Persistence

    Valkey or Redis OSS
    Snapshots and backups
    Memcached
    None on node-based clusters. Serverless Memcached can take backups.
  • Threads

    Valkey or Redis OSS
    Mostly single-threaded per shard
    Memcached
    Multithreaded
  • Scale

    Valkey or Redis OSS
    Cluster mode shards
    Memcached
    Add nodes
Choosing an ElastiCache engine.

1 / 2

  • Data types

    Valkey or Redis OSS
    Lists, sets, sorted sets, hashes
    Memcached
    Simple strings and objects
  • Replication

    Valkey or Redis OSS
    Replicas, automatic failover
    Memcached
    None
  • Persistence

    Valkey or Redis OSS
    Snapshots and backups
    Memcached
    None on node-based clusters. Serverless Memcached can take backups.

2 / 2

  • Threads

    Valkey or Redis OSS
    Mostly single-threaded per shard
    Memcached
    Multithreaded
  • Scale

    Valkey or Redis OSS
    Cluster mode shards
    Memcached
    Add nodes
Choosing an ElastiCache engine.
Application
ElastiCache
RDS
DAX
DynamoDBany dataon a missDynamoDB APIon a miss
ElastiCache fronts any database. DAX fronts DynamoDB only.

是什么

Valkey and Redis OSS support rich data types (lists, sets, sorted sets, hashes), replicas with automatic failover, snapshots and publish-subscribe messaging. They suit leaderboards, session stores and queues. Cluster mode splits the data over several shards, so you can scale memory and writes. Memcached is simpler: strings and objects, no replication, no persistence, but it uses many threads and scales by adding nodes.

是什么

DynamoDB Accelerator (DAX) is a cache made for DynamoDB. It speeds up reads from milliseconds to microseconds and uses the same DynamoDB API, so the application changes little. It caches items and query results, and it writes through to the table. Use ElastiCache for any other database or for computed data.

Size the cache to hold the hot data, the “working set”. When memory is full, the engine evicts keys, often the least recently used, or you set a time to live (TTL) on each key.

要记住

  • Valkey and Redis OSS: data types, replicas, automatic failover, backups, cluster mode.
  • Memcached: simple, multithreaded, no replication and no persistence. A node failure loses that node’s data.
  • DAX is the cache for DynamoDB. It needs no application redesign.
  • Use ElastiCache for session state, leaderboards and repeated database reads.

要记住

  • Eviction when memory is full: least recently used, or keys expire by TTL.
  • ElastiCache Serverless needs no node sizing.

考试中

  • “Microsecond reads for a DynamoDB table with minimal code change” points to DAX.
  • “Sorted leaderboard, sessions, replication and failover” points to ElastiCache for Valkey or Redis OSS.
  • “Simple, multithreaded object cache” points to Memcached.
  • “Reduce load on a relational database for repeated queries” points to ElastiCache.