Skip to main content

An embedded, in-process Redis-compatible database

Project description

burner-redis

Experimental: This library is under active development and not yet ready for production use. APIs may change without notice.

An embedded, in-process Redis-compatible database written in Rust with Python bindings. Drop-in replacement for redis.asyncio.Redis that runs inside the host process with no external server needed.

Built to back docket and self-hosted Prefect servers without requiring a separate Redis deployment.

Installation

pip install burner-redis

Requires Python 3.9+. Pre-built wheels available for Linux (x86_64, aarch64) and macOS (x86_64, arm64).

Quick start

from burner_redis import BurnerRedis

db = BurnerRedis()

# Use like redis.asyncio.Redis
await db.set("key", "value")
value = await db.get("key")

# Persistence across restarts
db = BurnerRedis(persistence_path="data.dat")
await db.set("key", "value")
# Data is saved on process exit and reloaded on next start

Supported commands

Strings

SET (with NX/EX/PX), GET, MGET, DELETE, EXISTS, KEYS, TTL, EXPIRE

Hashes

HSET, HGET, HDEL, HGETALL, HVALS, HEXISTS, HINCRBY

Sets

SADD, SMEMBERS, SISMEMBER, SREM

Sorted sets

ZADD, ZREM, ZRANGE (with WITHSCORES), ZRANGEBYSCORE (with WITHSCORES/LIMIT), ZRANGESTORE, ZREMRANGEBYSCORE, ZCARD, ZSCORE, ZCOUNT

Streams

XADD, XREAD, XLEN, XRANGE, XDEL, XTRIM, XGROUP CREATE, XGROUP DESTROY, XREADGROUP, XACK, XAUTOCLAIM, XCLAIM, XINFO GROUPS, XINFO CONSUMERS, XPENDING, XPENDING RANGE

Pub/Sub

PUBLISH, SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBSUB CHANNELS, PUBSUB NUMSUB, PUBSUB NUMPAT

Scripting

EVAL, EVALSHA, SCRIPT LOAD, SCRIPT EXISTS

Python-layer features

  • Pipeline — buffer commands and execute in batch, matching redis.asyncio.Redis.pipeline() semantics
  • Lock — distributed-style locking with atomic Lua-based release, matching redis.asyncio.Redis.lock() semantics
  • PubSub — async message listener with channel and pattern subscriptions
  • Script — register and call Lua scripts, matching redis.asyncio.Redis.register_script()

Persistence

Pass persistence_path to save state to disk on shutdown and restore on startup:

db = BurnerRedis(persistence_path="burner-redis.dat")
  • Crash-safe writes (atomic temp file + rename)
  • Expired keys excluded from snapshots
  • Manual save available via await db.save() or await db.save(path="custom.dat")
  • MessagePack binary format

redis-py compatibility

burner-redis implements a subset of the redis.asyncio.Redis interface — enough to back docket and common Prefect server workflows, but not the full redis-py API. Commands not yet implemented will raise NotImplementedError.

When the redis package is installed, exceptions subclass redis.exceptions.ResponseError and redis.exceptions.NoScriptError so existing error handling works unchanged.

Development

# Prerequisites: Rust 1.85+, Python 3.10+, uv

# Development build
uv run maturin develop

# Run tests
uv run pytest

# Run Rust tests
cargo test

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

burner_redis-0.1.2.tar.gz (507.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

burner_redis-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

burner_redis-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

burner_redis-0.1.2-cp310-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

burner_redis-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file burner_redis-0.1.2.tar.gz.

File metadata

  • Download URL: burner_redis-0.1.2.tar.gz
  • Upload date:
  • Size: 507.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for burner_redis-0.1.2.tar.gz
Algorithm Hash digest
SHA256 189698190835809f73fdb5af9ead4962975181c7fc8297045a5d831c0d465add
MD5 d8b968c1266f6769966300cb2132dc3a
BLAKE2b-256 a4308b219fc8863c652ef294d9a6075752cf14eade2f050e956410873f6f0270

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.2.tar.gz:

Publisher: release.yml on prefectlabs/burner-redis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file burner_redis-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for burner_redis-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f57d922efe3b58b9dd86af6af4265352ac2741d85717a51dc2682efc38316bb
MD5 5a95912d0bfbe3a6f82cff144d14569b
BLAKE2b-256 8d9f9dfff9d9e8521afcb1c65ad03b4cf465d3c950d3e5a9caf682d37705340f

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on prefectlabs/burner-redis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file burner_redis-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for burner_redis-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f859b6fc601bd7a57eae0c2f88a4d5a3f89f62b7f7a9c41502940d3d085c7ad9
MD5 51bc96087b3da04c5efe86920c8aec4b
BLAKE2b-256 253d7b2ba60935dde67d3a9fb20a1e5b8fba16490870dd4c20ad4c2858f26a99

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on prefectlabs/burner-redis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file burner_redis-0.1.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for burner_redis-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 62224dc3d20ac1cb04f2b9f6d757002b6005e89e42424bd006fcb96f4d5796a7
MD5 e2978b8294abcfdc6a8aa9e9362f4797
BLAKE2b-256 7958bbb2d2392fd272073ff0df7dae92b2c5aca90efa336b38defcc79140b0e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on prefectlabs/burner-redis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file burner_redis-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for burner_redis-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 61bff010740b3e333401a568c57342f71f1db5c8a64c88d66d60fbde45a8f615
MD5 73962d9cec1361b896a99bcc8865ef69
BLAKE2b-256 968b08eef1be018bf1a660cd6fab320a4226be69e78f05c3656d373c0156777f

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on prefectlabs/burner-redis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page