Browse the documentation

Encryption at rest

AES-256-GCM encryption of persisted data and key rotation.

Enterprise

What is encrypted

With encryption at rest enabled, NetlyDB encrypts the data it persists - snapshots and the write-ahead log - with AES-256-GCM. Existing plaintext files remain readable, so encryption can be turned on for an existing store; data is encrypted as it is rewritten.

builder.Services.AddNetlyDB(options =>
{
    options.Security.Encryption.Enabled = true;

    // A key ring supports rotation: new writes use PrimaryKeyId, every key in the ring can still decrypt.
    options.Security.Encryption.Keys =
    [
        new NetlyDBEncryptionKey { Id = "2026-09", KeyBase64 = secrets["netlydb-key-2026-09"] },
        new NetlyDBEncryptionKey { Id = "2026-03", KeyBase64 = secrets["netlydb-key-2026-03"] }
    ];
    options.Security.Encryption.PrimaryKeyId = "2026-09";
});
What encryption at rest covers, and in which order it is applied Your documentsin memory: plaintext Compressoptional, always first EncryptAES-256-GCM, PrimaryKeyId Disksnapshots + WAL Key ring every key decrypts what was written under its id; new writes use the primary key Not covered: exports (plaintext JSON by design), data in memory, traffic between nodes (use cluster TLS) Existing plaintext files stay readable; data is encrypted as it is rewritten.
Compression, when enabled, runs before encryption. The key ring lets older keys keep decrypting while new writes use the primary key.

Keys and rotation

  • A single 256-bit key can be supplied as KeyBase64. Source it from a secret store, never from source code.
  • For rotation, use a key ring: every key in Keys can decrypt data written under its id, and new writes use PrimaryKeyId. Keep an old key in the ring until the data written under it has been rewritten.
  • With compression enabled, data is compressed before it is encrypted.

What encryption at rest does not cover

  • Exports are plaintext JSON by design.
  • Data in memory, and data sent between cluster nodes, is decrypted; protect replication traffic with cluster TLS.
An unhandled error has occurred. Reload X

Reconnecting

Restoring the connection to the server...

Still trying

Next attempt in seconds

Connection lost

We could not reach the server.