Repository navigation
v2.1.0
Sorted sets, reproducible benchmarks against Redis, Valkey and Dragonfly, and faster hot keys. This release follows up on the feedback from BoltCache's first Hacker News thread.
Added
- Sorted sets:
ZADD(NX/XX/GT/LT/CH/INCR),ZINCRBY,ZSCORE,ZMSCORE,ZCARD,ZCOUNT,ZRANK/ZREVRANK(WITHSCORE),ZREM,ZRANGE(BYSCORE/REV/LIMIT/WITHSCORES),ZREVRANGE,ZRANGEBYSCORE,ZREVRANGEBYSCORE,ZPOPMIN/ZPOPMAX,ZREMRANGEBYRANK/ZREMRANGEBYSCOREandZSCAN. They're backed by a skiplist with O(log n) ranks, persisted in snapshots, filterable withSCAN ... TYPE zsetand returned byGET /cache/{key}. - Reproducible benchmarks:
bench/run.shcompares BoltCache with Redis (with and without I/O threads), Valkey and Dragonfly under the same pinned CPU budget, and a GitHub Actions workflow runs it. Results and methodology are in BENCHMARKS.md. - README sections on project status, when (not) to use BoltCache with a comparison to Redis/Valkey, Dragonfly, NATS and etcd, and how the project is built and verified.
- Issue templates; private vulnerability reporting is enabled.
Performance
- Commands pipelined by a client that hit the same shard now run under a single lock acquisition, and shard locks spin briefly before blocking. This removes most lock contention on hot keys. On an M1 Pro, unpipelined
ZADDto one key went from 55K to 114K ops/s, and pipelinedHSETfrom 800K to 1.33M. - Skiplist nodes embed their level arrays, so a random insert into a 100K-member sorted set takes 2.4 µs instead of 3.2 µs.
Changed
- Performance claims in the README now come only from the reproducible benchmark, including where BoltCache is slower: pipelined
ZADD, andSET/GETon 2 cores.
Install
docker run -d -p 6382:6382 -p 8090:8090 -v boltcache-data:/data ghcr.io/wutlu/boltcache:2.1.0
go install github.com/wutlu/boltcache/v2@v2.1.0Or download a binary below.