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.3.tar.gz (597.4 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.3-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.3-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.3-cp310-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

burner_redis-0.1.3-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.3.tar.gz.

File metadata

  • Download URL: burner_redis-0.1.3.tar.gz
  • Upload date:
  • Size: 597.4 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.3.tar.gz
Algorithm Hash digest
SHA256 b849b3aa6d55f5d58845ce36693c2c39b54550c4e82518001d72b798321731dc
MD5 024ab753dabf8ab640ad7fe83235f372
BLAKE2b-256 03e5285d6c67bac67b208256c77252f6208ca9e82bc794bfd9f91a9e72aacf2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.3.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.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for burner_redis-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 961b255186af0cddf0fc6069ba77acd78ac0232e6c7f09a279e5be940bb6cfcc
MD5 3d5f439b311757773f785f8c90f1be32
BLAKE2b-256 7684d15e7b11fed7b0c47dcd535523d4c480cb8e310c5ddc69517cf48461cc80

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.3-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.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for burner_redis-0.1.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 eb8ffac3473c6b957b0a59ce06033239cbd2c7382bf25d27cb62d4e2df784112
MD5 cade639b8c55f3e125ac3c42794a6225
BLAKE2b-256 a497c7c1d7febe9cf27e1e45fea2f55854e7461edfef7543f6a15c2bab05a641

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.3-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.3-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for burner_redis-0.1.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a5396e73ce678a98fca894ff476badfb7e87f367111904259afa8175d4bd9939
MD5 10ce1be136a42425632d2a6dcf3becf7
BLAKE2b-256 176e3c5c5328a9d8dc0d3a3c8761d2cb01eccd2498cceb4867e7a91d791bb735

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.3-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.3-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for burner_redis-0.1.3-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9aa06d89f22f1dea6fe72f5c902bc908a52ce4f139fd6d102540a51aefeeef32
MD5 b801cce914cc1343032db16a2fa900d2
BLAKE2b-256 946fd1dd3a8d7f9868b29d5f9722d9be09243a844f829e7d033f8aec50fe32e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for burner_redis-0.1.3-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