# MemoryDB: Speed, Durability, and Composition.

DevFeed: [MemoryDB: Speed, Durability, and Composition.](<https://devfeed.tech/articles/memorydb-speed-durability-and-composition-12556.md>)

Original publisher: [Read original article](<http://brooker.co.za/blog/2024/04/25/memorydb.html>)

Author: Marc Brooker

Published: 2024-04-25T00:00:00Z

Content type: opinion

Language: en

Sources: [Marc Brooker's Blog](<https://devfeed.tech/sources/marc-brooker-s-blog.md>), [Marc Brooker's Blog](<https://devfeed.tech/sources/marc-brooker-s-blog-2.md>)

Topics: [Redis](<https://devfeed.tech/topics/redis.md>), [Database](<https://devfeed.tech/topics/database.md>), [distributed-systems](<https://devfeed.tech/topics/distributed-systems.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Availability](<https://devfeed.tech/topics/availability.md>), [Scalability](<https://devfeed.tech/topics/scalability.md>), [systems](<https://devfeed.tech/topics/systems.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [Security](<https://devfeed.tech/topics/security.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [availability](<https://devfeed.tech/tags/availability.md>), [aws](<https://devfeed.tech/tags/aws.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [database](<https://devfeed.tech/tags/database.md>), [distributed-systems](<https://devfeed.tech/tags/distributed-systems.md>), [redis](<https://devfeed.tech/tags/redis.md>), [replication](<https://devfeed.tech/tags/replication.md>), [scalability](<https://devfeed.tech/tags/scalability.md>), [security](<https://devfeed.tech/tags/security.md>)

## AI overview

The article explains Amazon MemoryDB for Redis, a durable and highly available cloud database that preserves Redis compatibility while providing microsecond reads, single-digit millisecond writes, strong consistency, multi-AZ durability, and rapid recovery. It focuses on how composing Redis with a transaction journal service provides performance, replication, leader election, reconfiguration safety, and organizational leverage.

## Source excerpt

MemoryDB: Speed, Durability, and Composition. Blocks are fun. Earlier this week, my colleagues Yacine Taleb, Kevin McGehee, Nan Yan, Shawn Wang, Stefan Mueller, and Allen Samuels published Amazon MemoryDB: A fast and durable memory-first cloud database1. I'm excited about this paper, both because its a very cool system, and because it gives us an opportunity to talk about the power of composition in distributed systems, and about the power of distributed systems in general. But first, what is MemoryDB? Amazon MemoryDB for Redis is a durable database with microsecond reads, low single-digit millisecond writes, scalability, and enterprise security. MemoryDB delivers 99.99% availability and near instantaneous recovery without any data loss. or, from the paper: We describe how, using this architecture, we are able to remain fully compatible with Redis, while providing single-digit millisecond write and microsecond-scale read latencies, strong consistency, and high availability. This is remarkable: MemoryDB keeps compatibility with an existing in-memory data store, adds multi-AZ (multi-datacenter) durability, adds high availability, and adds strong consistency on failover, while still improving read performance and with fairly little cost to write performance. How does that work? As usual, there's a lot of important details, but the basic idea is composing the in-memory store (Redis) with our existing fast, multi-AZ transaction journal2 service (a system we use in many places inside AWS). Composition What's particularly interesting about this architecture is that the journal service doesn't only provide durability. Instead, it provides multiple different benefits: durability (by synchronously replicating writes onto storage in multiple AZs), fan-out (by being the replication stream replicas can consume), leader election (by having strongly-consistent fencing APIs that make it easy to ensure there's a single leader per shard), safety during reconfiguration and resharding