Chronicle
1.x
Docs/Chronicle/Redis Store
Open

Reading1 min
Updated31 Jul 2026
Sourcev1/stores/redis.mdx

The store/redis package implements Chronicle's store.Store interface using Grove KV backed by the Redis driver. All entities are stored as JSON via Grove KV, making it suitable for high-throughput, low-latency audit and event logging.

Import01

import (
    "github.com/xraph/grove/kv"
    "github.com/xraph/grove/kv/drivers/redisdriver"
    "github.com/xraph/chronicle/store/redis"
)

Constructor02

kvStore, err := kv.Open(redisdriver.Open("redis://localhost:6379/0"))
if err != nil {
    log.Fatal(err)
}

s := redis.New(kvStore)

Migrations03

if err := s.Migrate(ctx); err != nil {
    log.Fatal(err)
}

Migrate is a no-op for Redis (schemaless). It is safe to call on every startup for consistency with other backends.

Full setup with chronicle.New04

import (
    "context"
    "log"

    "github.com/xraph/grove/kv"
    "github.com/xraph/grove/kv/drivers/redisdriver"
    "github.com/xraph/chronicle"
    "github.com/xraph/chronicle/store"
    chronicleredis "github.com/xraph/chronicle/store/redis"
)

ctx := context.Background()

kvStore, err := kv.Open(redisdriver.Open("redis://localhost:6379/0"))
if err != nil {
    log.Fatal(err)
}

s := chronicleredis.New(kvStore)

adapter := store.NewAdapter(s)

c, err := chronicle.New(chronicle.WithStore(adapter))

With the Forge extension05

import "github.com/xraph/chronicle/extension"

ext := extension.New(extension.WithStore(s))
app.Register(ext)

Interfaces implemented06

redis.Store satisfies:

  • audit.Store

  • stream.Store

  • verify.Store

  • erasure.Store

  • retention.Store

  • compliance.ReportStore

  • store.Store (composite)

Characteristics07

AspectDetail
DriverGrove KV + redisdriver
MigrationsNo-op (schemaless)
Pingkv.Ping(ctx)
CloseNo-op -- caller owns the *kv.Store lifecycle

When to use08

  • High-throughput, low-latency event and audit logging.

  • Ephemeral workloads where persistence is not critical.

  • Environments already running Redis for caching or pub/sub.