A compact Redis-compatible cache written in Go, with strings, hashes, TTL, Pub/Sub, persistence, a custom replication stream, and memory eviction.
Blueis implements a focused RESP2 command subset. It is useful for local cache workflows and for studying how a cache server works. Redis Cluster, Sentinel, failover, authentication, TLS, Lua, and Redis's replication handshake are outside its scope.
Requires Go 1.25.0 or newer. redis-cli is optional for the examples.
go run ./cmd/blueisredis-cli -p 6380PING
SET greeting "hello from Blueis"
GET greeting
HSET user:1 name Ishjaap role builder
HGET user:1 role
INCR visits
SET session:1 active EX 30
TTL session:1
INFO memory
On Windows, ./scripts/run.ps1 starts the server and ./scripts/demo.ps1
runs an isolated demo using randomly prefixed keys, then removes those keys.
- Binary-safe strings and hashes; multi-key reads/writes; integer counters.
- Key expiry with absolute deadlines preserved across new persistence records.
- Transactions that hide pending writes and roll back on failed durable commits.
- Synced, checksummed AOF state records and checksummed snapshot files.
- Exact recorded eviction results with
noeviction, LRU, and LFU policies. - Pub/Sub, MONITOR, and resumable Blueis replication with bounded buffers.
- INFO section selection and COMMAND metadata.
- Configurable client limits, idle timeouts, write timeouts, and graceful shutdown.
| Setting | Default |
|---|---|
| Address | 127.0.0.1:6380 |
| AOF | data/appendonly.aof |
| Snapshot | data/snapshot.json |
| Snapshot interval / writes | 60s / 1000 |
| Maximum connected clients | 1024 |
| Client read idle timeout | 5m |
| Client write timeout | 10s |
| Maximum estimated memory | Unlimited |
| Eviction policy | noeviction |
go run ./cmd/blueis -addr 127.0.0.1:6380 -maxclients 256 -idle-timeout 10m -write-timeout 5sUse -aof= or -snapshot= to disable that persistence mechanism. Use zero for
client limits/timeouts or snapshot scheduling settings to disable that limit,
timeout, or trigger. Negative settings are rejected.
The default binds loopback. Binding :6380 exposes the unauthenticated server
on all interfaces; use a trusted network if you choose that configuration.
go test ./...
go test -race ./...
go vet ./...
go build ./cmd/blueisWindows helpers: ./scripts/test.ps1 and ./scripts/build.ps1.
Tests need local TCP and file replacement access. The test helper runs every
package, runs vet, and exits on failure.
CI runs tests and builds on Linux and Windows, Linux race detection, formatting, and a comparison suite against Redis 7.4. To run the comparison locally:
BLUEIS_REDIS_ADDR=127.0.0.1:6379 go test ./internal/server -run TestRedisCompatibility -vThe comparison uses unique test keys and removes them afterward. On PowerShell,
set $env:BLUEIS_REDIS_ADDR before running the Go command.
- Command reference: syntax, replies, supported options, limits.
- Operations: configuration, restart recovery, disk failures, persistence migration, monitoring, and replication.
- Architecture: transaction boundaries, undo logs, wire formats, and package map.
- Development and benchmarks: checks, tests, benchmark commands, measured results, and remaining scope limits.
- Maintenance completion notes.
MIT, copyright 2026 Ishjaap Singh. The license text follows the Open Source Initiative MIT template.