RedisLess is a fast, lightweight, embedded and scalable in-memory Key/Value store library compatible with the Redis API.
THIS PROJECT IS TESTABLE, BUT NOT PRODUCTION READY YET!!
RedisLess is a fast, lightweight, embedded and scalable in-memory Key/Value store library compatible with the Redis API.
RedisLess is the concatenation of Redis and Serverless.
As a backend developer, I mostly work on providing web API for frontend developers and backend developers. Redis is part of my toolset - especially when I share data and sync states between my backend apps. For those simple use cases, I don't want to have to spawn a Redis server.
So, imagine a world where your Redis instance is nothing more than a lib in your app. Imagine that this lib can sync the data with other neighborhood instances?
That's the idea behind RedisLess, a lightweight, embedded, and scalable in-memory Key/Value store library compatible with the Redis API.
Follow me on Twitter 🙋♂️
Read more about RedisLess:
To use RedisLess, you only need to:
redis://localhost:16379
.Under the hood, the RedisLess library starts a local Redis API compatible instance on port 16739
(you can change the port).
# RedisLess library with Python binding
npm install redisless
# redis client
npm install async-redis
const {RedisLess} = require('redisless');
const redis = require('async-redis');
const port = 16379;
const redisless = new RedisLess(port);
redisless.start();
const r = redis.createClient({host: 'localhost', port: port});
await r.set('foo', 'bar');
await r.get('foo'); // return 'bar'
await r.del('foo'); // delete key 'foo'
redisless.stop();
# RedisLess library with Python binding
pip install redisless
# redis client
pip install redis
from redisless import RedisLess
import redis
redisless = RedisLess()
# start RedisLess embedded instance
redisless.start()
# Connect to RedisLess on localhost:16379
redis = redis.Redis(host='localhost', port=16379)
redis.set('foo', 'bar')
redis.get('foo') # return bar
redis.delete('foo') # return 1
# stop RedisLess embedded instance
redisless.stop()
What RedisLess is not:
The goal of RedisLess is not to remove the need of Redis server for heavy workload. If you consider to store more than 2 GB of data in RedisLess you are better to use Redis. There is no hard limit, but RedisLess is designed to manage and share small dataset between apps.
✅ Good use cases:
❌ Bad use cases:
Strong attention to performance and code cleanliness is given when designing RedisLess. It aims to be crash-free, super-fast and put a minimum strain on your server resources.
RedisLess is written in Rust and export functions through FFI (Foreign Function Interface), making it usable from any language. We provide clients for NodeJS, Python, Golang, Java, and Rust. Supporting a new language can be done in 5 minutes. Look at Python and NodeJS clients implementation for inspiration.
It is never too soon to contribute to a great project. If you are interested in contributing, please join us on Discord, then we can discuss. The project is in its early days, but we are serious about building a solid library to help thousands of developers.
brew install mingw-w64
to cross build for Windowsbrew install FiloSottile/musl-cross/musl-cross
to cross build for Linuxbrew tap SergioBenitez/osxct && brew install x86_64-unknown-linux-gnu
# to cross build for LinuxTo build NodeJS, Python, Golang and other libs you need to run:
cd scripts && ./build-for-mac.sh && cd ..
Once the libs built, you are ready to use the clients into the clients folder.
Thanks to our contributors ❤️