Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 68 additions & 11 deletions PLAN.md

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Eventually consistent, read-heavy distributed cache for shared runtime storage (Go).

In-process Engine or dedicated nodes. Owner writes with async fan-out, local reads, gossip membership, load-through keyspaces, structured types (Bloom / Set / ZSet / Geo / List / Hash / Counter / JSON / Bitmap / HLL / TopK / CMS / VectorSet), and a bounded per-node LRU.
In-process Engine or dedicated nodes. Owner writes with async fan-out, local reads, gossip membership, load-through keyspaces, structured types (Bloom / Set / ZSet / Geo / List / Hash / Counter / JSON / Bitmap / HLL / TopK / CMS / VectorSet / Stream), and a bounded per-node LRU.

```text
github.com/Code0987/supercache
Expand Down Expand Up @@ -89,6 +89,9 @@ go run ./cmd/sc -keyspace vectorset vadd products north 0,1
go run ./cmd/sc -keyspace vectorset vadd products ne 0.7,0.7
go run ./cmd/sc -keyspace vectorset vcard products
go run ./cmd/sc -keyspace vectorset vsim products 1,0.05 3
# go run ./cmd/sc -keyspace events xadd logs * '{"msg":"hello"}'
# go run ./cmd/sc -keyspace events xlen logs
# go run ./cmd/sc -keyspace events xrange logs - + 10
go run ./cmd/sc -keyspace seen bloom add users alice # ModeBloom keyspace
# ModeTopK (register a ModeTopK keyspace, or use examples/billboard plays/hot):
# go run ./cmd/sc -keyspace plays topkadd hot t001
Expand Down Expand Up @@ -200,9 +203,9 @@ Apps: `client.DialTLS` with `pkg/tlsconfig.ClientFiles`. See [docs/OPERATIONS.md

| Package | Role |
|---------|------|
| `pkg/engine` | Core Get/Put/Delete, Bloom/Set/ZSet/Geo/List/Hash/Counter/JSON/Bitmap/HLL/TopK, keyspaces, cluster routing |
| `pkg/engine` | Core Get/Put/Delete, Bloom/Set/ZSet/Geo/List/Hash/Counter/JSON/Bitmap/HLL/TopK/CMS/VectorSet/Stream, keyspaces, cluster routing |
| `pkg/store` | Versioned LRU memory store (immediate Set / RYOW; structure caches) |
| `pkg/keyspace` | Config: `LoadThrough` / `CacheOnly` / `Bloom` / `Set` / `ZSet` / `Geo` / `List` / `Hash` / `Counter` / `JSON` / `Bitmap` / `HLL` / `TopK` |
| `pkg/keyspace` | Config: `LoadThrough` / `CacheOnly` / `Bloom` / `Set` / `ZSet` / `Geo` / `List` / `Hash` / `Counter` / `JSON` / `Bitmap` / `HLL` / `TopK` / `CMS` / `VectorSet` / `Stream` |
| `pkg/bloom` | Bitset Bloom filter used by `ModeBloom` |
| `pkg/set` | Exact set encode/decode for `ModeSet` |
| `pkg/zset` | Sorted-set encode/decode for `ModeZSet` |
Expand All @@ -215,17 +218,19 @@ Apps: `client.DialTLS` with `pkg/tlsconfig.ClientFiles`. See [docs/OPERATIONS.md
| `pkg/hllx` | Dense HyperLogLog sketch for `ModeHLL` |
| `pkg/topkx` | Space-Saving top-K table for `ModeTopK` |
| `pkg/cmsx` | Count-Min Sketch for `ModeCMS` |
| `pkg/vecset` | Embedding set + K-NN for `ModeVectorSet` |
| `pkg/stream` | Append-only log codec for `ModeStream` |
| `pkg/datasource` | Backend loader interface |
| `pkg/protect` | Rate limit + circuit breaker |
| `pkg/admin` | `/healthz` `/readyz` `/peers` `/keyspaces` `/metrics` + `/docs` (Swagger) |
| `api/openapi` | OpenAPI 3 specs (Admin + Cache gRPC reference) |
| `pkg/telemetry` | Counters + OpenTelemetry |
| `pkg/membership` | Gossip + ring rebuild |
| `pkg/warmup` | Hot keys, topology handoff (hot then rest), refresh-ahead |
| `pkg/client` | Application gRPC client (KV + Bloom + Set + ZSet + Geo + List + Hash + Counter + JSON + Bitmap + HLL + TopK) |
| `pkg/client` | Application gRPC client (KV + Bloom + Set + ZSet + Geo + List + Hash + Counter + JSON + Bitmap + HLL + TopK + CMS + VectorSet + Stream) |
| `pkg/tlsconfig` | TLS/mTLS config from PEM files |
| `cmd/supercache-node` | Node binary (`-demo-keyspace`: cacheonly / set / zset / hash / json / bitmap / vectorset) |
| `cmd/sc` | CLI: get/put/del, bloom, sadd*, z*, geo*, l*, h*, incr/cget, json*, bit*, hlladd/hllcount, topkadd/topklist, admin diagnostics |
| `cmd/sc` | CLI: get/put/del, bloom, sadd*, z*, geo*, l*, h*, incr/cget, json*, bit*, hlladd/hllcount, topkadd/topklist, cmsincr/cmsquery, vadd*, xadd* |
| `cmd/scbench` | SuperCache vs Redis load harness + in-process matrix |

## Consistency
Expand All @@ -237,7 +242,7 @@ SuperCache is **eventually consistent**. Writes ACK on the owner; fan-out is asy
- `UpdateKeySpace` is **local** — re-issue on every node; compare `keyspace_hashes` on `/peers`.
- Topology change: existing nodes async-push inventory to peers (hot keys first, then rest). See [docs/CLUSTER_FLOWS.md](./docs/CLUSTER_FLOWS.md).
- Delete installs a versioned tombstone for `TombstoneTTL` (default 5m) so a delayed ApplyPut cannot resurrect the key.
- Keyspace modes: **CacheOnly** / **LoadThrough** (KV), **ModeBloom**, **ModeSet**, **ModeZSet**, **ModeGeo**, **ModeList**, **ModeHash**, **ModeCounter**, **ModeJSON**, **ModeBitmap**, **ModeHLL**, **ModeTopK**, **ModeCMS**. Wrong verb → invalid argument. API summary: [docs/API.md](./docs/API.md). Designs: [Bloom](./docs/design/2026-08-11-bloom-filter.md), [Set](./docs/design/2026-08-13-mode-set.md), [ZSet](./docs/design/2026-08-13-mode-zset.md), [Geo](./docs/design/2026-08-19-mode-geo.md), [List](./docs/design/2026-08-19-mode-list.md), [Hash](./docs/design/2026-08-20-mode-hash.md), [Counter](./docs/design/2026-08-20-mode-counter.md), [JSON](./docs/design/2026-08-21-mode-json.md), [Bitmap](./docs/design/2026-08-21-mode-bitmap.md), [HLL](./docs/design/2026-08-25-mode-hll.md), [TopK](./docs/design/2026-08-31-mode-topk.md), [CMS](./docs/design/2026-09-01-mode-cms.md).
- Keyspace modes: **CacheOnly** / **LoadThrough** (KV), **ModeBloom**, **ModeSet**, **ModeZSet**, **ModeGeo**, **ModeList**, **ModeHash**, **ModeCounter**, **ModeJSON**, **ModeBitmap**, **ModeHLL**, **ModeTopK**, **ModeCMS**, **ModeVectorSet**, **ModeStream**. Wrong verb → invalid argument. API summary: [docs/API.md](./docs/API.md). Designs: [Bloom](./docs/design/2026-08-11-bloom-filter.md), [Set](./docs/design/2026-08-13-mode-set.md), [ZSet](./docs/design/2026-08-13-mode-zset.md), [Geo](./docs/design/2026-08-19-mode-geo.md), [List](./docs/design/2026-08-19-mode-list.md), [Hash](./docs/design/2026-08-20-mode-hash.md), [Counter](./docs/design/2026-08-20-mode-counter.md), [JSON](./docs/design/2026-08-21-mode-json.md), [Bitmap](./docs/design/2026-08-21-mode-bitmap.md), [HLL](./docs/design/2026-08-25-mode-hll.md), [TopK](./docs/design/2026-08-31-mode-topk.md), [CMS](./docs/design/2026-09-01-mode-cms.md), [VectorSet](./docs/design/2026-09-04-mode-vector-set.md), [Stream](./docs/design/2026-09-08-mode-stream.md).

Details: [PLAN.md](./PLAN.md) §3 / §7 and [docs/OPERATIONS.md](./docs/OPERATIONS.md).

Expand Down
Loading
Loading