Skip to content

dahomey-technologies/RedisCBOR

Repository files navigation

RedisCBOR

RedisCBOR is a Redis module that implements CBOR as a native data type. It allows storing, updating and fetching CBOR documents from Redis keys (documents).

It is based on RedisJson for its concepts, its commands and their syntax.

Benefits of CBOR over JSON:

  • ~25% smaller memory footprint / bandwidth, depending on which type are used (text will have the same footprint in JSON or CBOR)
  • integer, floats, boolean and null types should be faster to deserialize because they are encoded in binary, consequently there is no parsing from text to process.

Primary features:

  • Full support of the CBOR standard
  • CBORPath syntax for selecting elements inside documents
  • Documents are stored as raw CBOR binary data, allowing reduced memory footprint
  • Typed atomic operations for all CBOR types

Build

With Docker

Run the following on the main directory:

docker build -t redis-cbor .

From Source

Make sure you have Rust installed: https://www.rust-lang.org/tools/install

Run the following on the main directory:

cargo build --release

When running the tests, you need to explicitly specify the test feature to disable use of the Redis memory allocator when testing:

cargo test --features test

Run

With Docker

run the built image:

docker run --name redis-cbor -d -p 6379:6379 redis-cbor

From Source

Run Redis pointing to the newly built module:

redis-server --loadmodule ./target/release/librecbor.so

Alternatively add the following to a redis.conf file:

loadmodule /path/to/modules/librecbor.so

Documentation

Read the docs here

About

RedisCBOR - a CBOR data type for Redis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages