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.
- 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
Run the following on the main directory:
docker build -t redis-cbor .Make sure you have Rust installed: https://www.rust-lang.org/tools/install
Run the following on the main directory:
cargo build --releaseWhen running the tests, you need to explicitly specify the test feature to disable use of the Redis memory allocator when testing:
cargo test --features testrun the built image:
docker run --name redis-cbor -d -p 6379:6379 redis-cborRun Redis pointing to the newly built module:
redis-server --loadmodule ./target/release/librecbor.soAlternatively add the following to a redis.conf file:
loadmodule /path/to/modules/librecbor.soRead the docs here