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.1.tar.gz (485.2 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.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

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

burner_redis-0.1.1-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.1-cp310-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

burner_redis-0.1.1-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.1.tar.gz.

File metadata

  • Download URL: burner_redis-0.1.1.tar.gz
  • Upload date:
  • Size: 485.2 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.1.tar.gz
Algorithm Hash digest
SHA256 defa5030d091e1387ba18a3e28d2077a75ec09d777b0aff1909e36fb0b0bb7f5
MD5 7f2553be6f5e2a690ec1089b0fcfa61b
BLAKE2b-256 30e4fc3a63afbe4d2cbbf0ea7b16431876ea2ce9e30084673364e2f5af05d042

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for burner_redis-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 08274c6fd95d3cd9a72dbaf52f08df6c11e6ba1a41c66db4b72c825a1728d660
MD5 a9e90312b43bfb9b134b2d903ed2b95a
BLAKE2b-256 15cc9ff8075c6b1f9aa83f3cdb3e8c8d85ec26a5001315c10949d149eb5d7422

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for burner_redis-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c422a126fb31355a13cd01d9004488e8cd91b77eeb3e3f1cb8d634b81eb184cf
MD5 7c8b897a475fef078f7512bd0ac6c716
BLAKE2b-256 4d241191731701cf5583209ca45bade477685daf54f0177020e8211f5b5f17c2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for burner_redis-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 09a51d944970713ed258b9f272ecbeb7e33b23d7eb35e236979c23ea5880225a
MD5 3fcf90611f2641610598c96bf5ac83d0
BLAKE2b-256 52cc9bf1a152eca712cc3eb5c1e8f5b1ae1c8cb5d5521456a43b28804393d85b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for burner_redis-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 04b37fae4562fffb2f41a8d9aa6ade85ce71495d8d771cd3f8370ea2a64c086e
MD5 ccb2cf956707235c2bacb2b4b2b51968
BLAKE2b-256 8588681ae7db3035d88f7876fad2323236ebe69415cced000f22c1237322da84

See more details on using hashes here.

Provenance

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