Rimcu is Go library for Redis server-assisted client side caching. In other words, it is a combination of Redis cient library and in memory cache library.
Redis 6 or newer, with it's client side caching feature
It caches the Redis data in your server's RAM and sync it to Redis server when the data changed. So you don't need to always ask the Redis server to get your cache data.
It supports three modes:
- RESP2: single node Redis with RESP2 protocol, it is the default one
- RESP2ClusterProxy: Redis cluster with RESP2 protocol and front proxy
- RESP3: single node Redis with RESP3 protocol, not fully tested yet
Features | Status | Description |
---|---|---|
Metrics Client | ❌ 🔧 | Configurable metrics client |
Password Support | ❌ 🔧 | |
Strings | ❌ 🔧 | redis strings data type |
list | ❌ 🔧 | redis list data type |
hash | ❌ 🔧 | redis hash data type |
Connection Pool
Features | Status | Description |
---|---|---|
Single Pool | ❌ 🔧 | Single conn pool for all cache types |
Vanilla Redigo Pool | ❌ 🔧 | Reuse vanilla redigo pool |
Max Number of Connections | ✅ | |
Waiting for connection with timeout | ✅ | |
Idle connection checking | ❌ 🔧 | |
Healthcheck | ❌ 🔧 |
We categorize the cache based on the Redis data types mention in https://redis.io/docs/manual/data-types/. We need to do this because each type of cache will be stored differently.
StringsCache is cache for redis strings
data type.
- Setex
- Get
- Del
- MSet (waiting support at RESP2)
- MGet (waiting support at RESP2)
- Append
IT IS UNDER REWORK
Old implementation can be found at https://github.com/iwanbk/rimcu/blob/v0.01/resp2/listcache.go#L33
ListCache is cache for Redis list data type which uses RESP2 protocol. It is still in very early development phase. See the godoc page for more explanation.
Implemented commands:
- [x]LPOP
- [x]RPUSH
- [x]GET (it is Rimcu specific command)
- [ ]...
Local Test
export TEST_REDIS_ADDRESS=127.0.0.1:6379 # replace with your redis 6 server
go test ./...
TODO
Features | Status | Description |
---|---|---|
Unify inmem cache | ❌ 🔧 | resp2 & resp3 currently using two different memcache lib |
- redigo redis package is copied and modified to this repo. It is used to provide RESP2 support.