> This paper presents Amazon MemoryDB, a fast and durable inmemory storage cloud-based service. A core design behind MemoryDB is to decouple durability from the in-memory execution
engine by leveraging an internal AWS transaction log service. In
doing so, MemoryDB is able to separate consistency and durability
concerns away from the engine allowing to independently scale
performance and availability. To achieve that, a key challenge was
ensuring strong consistency across all failure modes while maintaining the performance and full compatibility with Redis. MemoryDB
solves this by intercepting the Redis replication stream, redirecting
it to the transaction log, and converting it into synchronous replication. MemoryDB built a leadership mechanism atop the transaction
log which enforces strong consistency. MemoryDB unlocks new
capabilities for customers that do not want to trade consistency or
performance while using Redis API, one of the most popular data
stores of the past decade.
> MemoryDB solves this by intercepting the Redis replication stream, redirecting it to the transaction log, and converting it into synchronous replication
Replication is eventually consistent in Redis - is it saying that it’s intercepting the stream at the source and blocking the write from completing until replication completes? Cause intercepting it at the point it’s going out (which is what the word interception implies to me) wouldn’t get you strong consistency I would think.
"Due to our choice of using passive replication, mutations are
executed on a primary node before being committed into the trans-
action log. If a commit fails, for example due to network isolation,
the change must not be acknowledged and must not become visible.
Other database engines use isolation mechanisms like Multi-Version
Concurrency Control (MVCC) to achieve this, but Redis data struc-
tures do not support this functionality, and it cannot be readily
decoupled from the database engine itself. Instead, MemoryDB
adds a layer of client blocking. After a client sends a mutation, the
reply from the mutation operation is stored in a tracker until the
transaction log acknowledges persistence and only then sent to the
client. Meanwhile, the Redis workloop can process other operations.
Non-mutating operations can be executed immediately but must
consult the tracker to determine if their results must also be delayed
until a particular log write completes. Hazards are detected at the
key level. If the value or data-structure in a key has been modified
by an operation which is not yet persisted, the responses to read
operations on that key are delayed until all data in that response is
persisted. Replica nodes do not require blocking as mutations are
only visible once committed to three AZs"
We've used it at work for a specific use case where paying for a more expensive redis that survives downtime with no frills made sense. It's quite expensive but super easy to use.
Considering the functionality on offer the service does look particularly easy to work with, even though there's still a notion of a stateful cluster with per-node sizing & pricing. Perhaps the MemoryDB team will offer something more 'serverless' eventually.
If we had truly orthogonal systems, you could setup a RAM Disk, and run SQLite with the backing store file in the RAM disk, without any custom software needed at all.
Are you saying durability is "orthogonal" in that it should be managed outside of the database (in your example, perhaps by copying sqlite files to durable storage)?
If not, then your proposed design seems pretty different from MemoryDB; yours doesn't persist data in the event of machine loss or reboot.
For instance: it's hard to scale concurrent writes with SQLite. I read they have an enterprise paid version with higher write concurrency support, but have no idea how it works and whether it'd compare with Redis or MemoryDB's write concurrency levels.
Interesting stuff. We use MemoryDB as the underlying service for BullMQ, a NodeJS queue that’s built on top of Redis. We trade off a bit of speed and cost (MemoryDB costs more than Elasticache) for persistence and BullMQ’s many features, which is a good tradeoff for most apps.
This feels too high level. They just sort of explain how they are durable via a log (e.g. RedPanda) and store things in mem.
It'd be more interesting if they talked about what log they used (Kinesis? Something on another DB?), what did they use for a locking service and how did they handle failure cases, etc.
> This paper presents Amazon MemoryDB, a fast and durable inmemory storage cloud-based service. A core design behind MemoryDB is to decouple durability from the in-memory execution engine by leveraging an internal AWS transaction log service. In doing so, MemoryDB is able to separate consistency and durability concerns away from the engine allowing to independently scale performance and availability. To achieve that, a key challenge was ensuring strong consistency across all failure modes while maintaining the performance and full compatibility with Redis. MemoryDB solves this by intercepting the Redis replication stream, redirecting it to the transaction log, and converting it into synchronous replication. MemoryDB built a leadership mechanism atop the transaction log which enforces strong consistency. MemoryDB unlocks new capabilities for customers that do not want to trade consistency or performance while using Redis API, one of the most popular data stores of the past decade.
[0] https://assets.amazon.science/e0/1b/ba6c28034babbc1b18f54aa8...
> MemoryDB solves this by intercepting the Redis replication stream, redirecting it to the transaction log, and converting it into synchronous replication
Replication is eventually consistent in Redis - is it saying that it’s intercepting the stream at the source and blocking the write from completing until replication completes? Cause intercepting it at the point it’s going out (which is what the word interception implies to me) wouldn’t get you strong consistency I would think.
"Due to our choice of using passive replication, mutations are executed on a primary node before being committed into the trans- action log. If a commit fails, for example due to network isolation, the change must not be acknowledged and must not become visible. Other database engines use isolation mechanisms like Multi-Version Concurrency Control (MVCC) to achieve this, but Redis data struc- tures do not support this functionality, and it cannot be readily decoupled from the database engine itself. Instead, MemoryDB adds a layer of client blocking. After a client sends a mutation, the reply from the mutation operation is stored in a tracker until the transaction log acknowledges persistence and only then sent to the client. Meanwhile, the Redis workloop can process other operations. Non-mutating operations can be executed immediately but must consult the tracker to determine if their results must also be delayed until a particular log write completes. Hazards are detected at the key level. If the value or data-structure in a key has been modified by an operation which is not yet persisted, the responses to read operations on that key are delayed until all data in that response is persisted. Replica nodes do not require blocking as mutations are only visible once committed to three AZs"
https://aws.amazon.com/memorydb/
If not, then your proposed design seems pretty different from MemoryDB; yours doesn't persist data in the event of machine loss or reboot.
For instance: it's hard to scale concurrent writes with SQLite. I read they have an enterprise paid version with higher write concurrency support, but have no idea how it works and whether it'd compare with Redis or MemoryDB's write concurrency levels.
so thats 99.(eleven 9s) ?
where would this sort of database used? streaming financial instrument ticks? Do you point Kinesis and its able to write/read super quickly?
It'd be more interesting if they talked about what log they used (Kinesis? Something on another DB?), what did they use for a locking service and how did they handle failure cases, etc.