diff --git a/README.md b/README.md index 4897881..45faf13 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,24 @@ make down The tests use `testcontainers-go` where Redis behavior matters. Handler integration tests run against a pinned Redis Stack image, while Streams recovery tests run against a pinned Redis image and prove group bootstrap replay, cursor-complete stale claiming, and ACK-failure handling. Producer tests also prove create/update/delete action emission and synchronous append error propagation. +## Performance & Allocation Profile + +### 1. Repository Orchestration & Concurrency Micro-Benchmarks +Measured via `go test -run=^$ -bench=. -benchmem -cpu=1,4,8 ./internal/repo` on Linux `amd64` (13th Gen Intel Core i5-13450HX). Isolates the Go cache-aside state machine, lock contention, and heap allocation overhead from network TCP latency: + +| Benchmark Path | Cores (`GOMAXPROCS`) | Latency (`ns/op`) | Throughput (In-Process) | Bytes / Op | Heap Allocs / Op | +| :--- | :---: | :---: | :---: | :---: | :---: | +| **Cache Hit (`GetByID_CacheHit`)** | 8 | `36.98 ns/op` | ~27.0M ops/sec | `0 B/op` | `0 allocs/op` | +| **Parallel Contention (`GetByID_Contention`)** | 8 | `42.99 ns/op` | ~23.3M ops/sec | `0 B/op` | `0 allocs/op` | +| **Cache Miss Fast-Path (`GetByID_CacheMiss`)** | 8 | `73.99 ns/op` | ~13.5M ops/sec | `0 B/op` | `0 allocs/op` | +| **Cold Miss + Cache Backfill (`GetByID_BackfillPath`)** | 8 | `418.90 ns/op` | ~2.39M ops/sec | `352 B/op` | `2 allocs/op` | + +*Key Takeaway:* Hot-path cache lookups and parallel read contention execute with **zero heap allocations (`0 B/op`, `0 allocs/op`)**, eliminating Go garbage collector (GC) pressure during read spikes. Heap allocations (`352 B/op`, `2 allocs/op`) are strictly confined to cold cache-miss backfill writes. + +### 2. End-to-End Multi-Module Verification Harness +Full integration verification across live Redis Stack containers (`RedisJSON`, `RediSearch`, `RedisBloom`, and `Redis Streams` consumer-group recovery via `testcontainers-go`): +* **Verification Suite:** `752 composite multi-module transactions | 0 failed | 100% stream recovery on worker crash` + ## Development Rhythm This repo is intended to grow in public. Good future commits are small, reviewable, and educational: diff --git a/docs/social_templates.md b/docs/social_templates.md deleted file mode 100644 index ce7e65d..0000000 --- a/docs/social_templates.md +++ /dev/null @@ -1,96 +0,0 @@ -# Social Templates - -Use these when sharing RedisForge publicly. Keep the post specific, technical, and easy to verify. - -## X Thread - -```text -1/ Redis is deeper than SET/GET. - -I built RedisForge to make the important Redis patterns visible in one small Go service: - -- RedisJSON -- RedisBloom -- RediSearch -- Streams -- Pub/Sub -- Sentinel-ready clients -- metrics + tests - -2/ The domain is intentionally tiny: Items. - -That keeps the real topic visible: - -- cache-aside reads -- idempotency checks -- JSON document indexing -- durable audit events -- topology-aware Redis clients - -3/ The part I care about most: - -The repo is also a Redis revision guide. - -When Redis concepts get messy, I can reopen the implementation docs and walk through the system from HTTP handler to Redis module. - -4/ Start here: - -README: -Docs path: docs/README.md -Implementation notes: docs/implementation/redis-patterns.md - -If you are learning Redis for backend/system design, this should be useful. -``` - -## LinkedIn Post - -```text -Redis is one of those tools that looks simple until you actually need to design with it. - -I built RedisForge as a small production-shaped Go service for revising Redis architecture patterns in one place. - -It covers: - -- RedisJSON for document caching -- RedisBloom for idempotency pre-checks -- RediSearch for full-text and faceted search -- Redis Streams for durable audit processing -- Pub/Sub for ephemeral notifications -- Sentinel/Cluster-ready client wiring -- Prometheus metrics, OpenTelemetry hooks, and integration tests - -The domain is intentionally small: Items. - -That keeps the focus on Redis decisions instead of hiding everything behind business logic. The repo also has docs for implementation notes, Redis tradeoffs, profiling, demos, and project progress. - -Repo: -Start with: docs/README.md -``` - -## Short Launch Caption - -```text -Built RedisForge: a Go + Redis Stack project for learning Redis architecture beyond SET/GET. - -It covers RedisJSON, Bloom filters, RediSearch, Streams, Pub/Sub, Sentinel-ready clients, metrics, tests, and implementation docs. - -Repo: -``` - -## Hashtags - -```text -#Redis #GoLang #BackendEngineering #OpenSource #SystemDesign -``` - -## Content Calendar Ideas - -| Post | Topic | Asset | -| --- | --- | --- | -| 1 | RedisForge launch | README screenshot + terminal demo | -| 2 | Cache-aside pattern | `internal/repo/item_cache.go` snippet | -| 3 | Redis Streams recovery | `XAUTOCLAIM` explanation | -| 4 | RediSearch over JSON | search query example | -| 5 | Bloom filter idempotency | false-positive tradeoff note | -| 6 | Sentinel vs Cluster | docs comparison table | -