Skip to content

v2.1.0

Choose a tag to compare

@wutlu wutlu released this 22 Oct 16:27
· 5 commits to main since this release
a2796a6

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/ZREMRANGEBYSCORE and ZSCAN. They're backed by a skiplist with O(log n) ranks, persisted in snapshots, filterable with SCAN ... TYPE zset and returned by GET /cache/{key}.
  • Reproducible benchmarks: bench/run.sh compares 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 ZADD to one key went from 55K to 114K ops/s, and pipelined HSET from 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, and SET/GET on 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.0

Or download a binary below.