Hot-swap engines

Ship Tuesday.

Swap engines Wednesday.

The KvEngine trait decouples storage from protocol. Drain one engine, fill another. Zero downtime. Zero data loss. The swap takes less than 100ms.

Hot Cache

In-memory · Shared-nothing · FxHash routing · Sub-µs reads

zero downtime swap ↕
Akasha

LSM-tree · MVCC · Write-ahead log · Point-in-time recovery

Hot Cache active — in-memory, sub-µs
100%
Hot Cache
0%
Akasha
0
Dropped ops
100%
Uptime
0
Ops served
0 bytes
Data loss
Live ops counter
0
operations processed
Hot Cache
active engine
0.3ms
P99 latency
0
dropped
Hot CacheswapAkasha
Engine interface

One trait. Infinite engines.

kv_engine.rs
/// The trait every storage engine implements.
#[async_trait]
pub trait KvEngine: Send + Sync + 'static {
    async fn get(&self, key: &[u8])
        -> Result<Option<Value>, EngineError>;

    async fn set(&self, key: &[u8], value: Value,
        ttl: Option<Duration>) -> Result<(), EngineError>;

    async fn del(&self, key: &[u8])
        -> Result<bool, EngineError>;

    /// Drain all data for hot-swap migration.
    async fn drain(&self) -> Result<Vec<(Vec<u8>, Value)>>;

    /// Ingest data from another engine.
    async fn ingest(&self, data: Vec<(Vec<u8>, Value)>);
}

The best engine for Tuesday might not be the best for Saturday.

Zaps lets you change your mind at runtime.

Next: Audit Trail →Back to Identity