liveBook · Manning

MemoryDB

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

Amazon MemoryDB is a managed, durable, Redis-compatible in-memory database service that persists data using a distributed transaction log.

MemoryDB is an AWS in-memory database compatible with Redis. It writes data to disk while serving reads from memory, using a distributed transaction log across multiple data centers. This persistence makes it suitable as a primary database when a key-value store is sufficient. section 11.2.5

Persistence increases write latency from microseconds to milliseconds. Suitable workloads include shopping carts, CMS content and comments, and IoT device status. Compared with ElastiCache, MemoryDB favors persistence guarantees over use as a secondary data store. section 11.2.5 section 11.7

Store sessions and sorted-set scores

Install the Redis client and connect with redis-cli. SET session:gamer1 online EX 15 stores a session for 15 seconds; GET then returns the value before expiration and (nil) afterward. ZADD and ZRANGE maintain and retrieve a scored high-score list.

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Explains persistence, distributed logging, latency, deployment configuration, and basic Redis operations without detailed production operations.
Examples
Uses shopping carts, CMS content, IoT status, gaming sessions, and sorted-set high scores as examples.
What it assumes
Assumes familiarity with a preceding gaming example and basic Redis commands rather than teaching Redis data structures from zero.
What you can do after
Apply it via CloudFormation and redis-cli to deploy a cluster, store expiring sessions, and query sorted sets.
How it connects
Connects MemoryDB with Redis, Amazon ElastiCache, CloudFormation, key-value stores, and distributed transaction logs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.