| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
fido is a high-performance cache for Go, focusing on high hit-rates, high throughput, and low latency. Optimized using the best algorithms and lock-free data structures, nobody fetches better than Fido. Designed to thrive in unstable environments like Kubernetes, Cloud Run, or Borg.
It also features an optional multi-tier persistence architecture, so you can also think of it as an in-process redis/valkey replacement.
As of January 2026, nobody fetches better - and we have the benchmarks to prove it.
go get github.com/codeGROOVE-dev/fido
c := fido.New[string, int](fido.Size(10000))
c.Set("answer", 42)
val, ok := c.Get("answer")With persistence:
store, err := localfs.New[string, User]("myapp", "")
cache, err := fido.NewTiered(store)
err = cache.Set(ctx, "user:123", user) // sync write
err = cache.SetAsync(ctx, "user:456", user) // async writeFetch deduplicates concurrent loads to prevent thundering herd situations:
user, err := cache.Fetch("user:123", func() (User, error) {
return db.LoadUser("123")
})fido.Size(n) // max entries (default 16384)
fido.TTL(time.Hour) // default expirationMemory cache backed by durable storage. Reads check memory first; writes go to both.
| Backend | Import |
|---|---|
| Local filesystem | pkg/store/localfs |
| Valkey/Redis | pkg/store/valkey |
| Google Cloud Datastore | pkg/store/datastore |
| Auto-detect (Cloud Run) | pkg/store/cloudrun |
For maximum efficiency, all backends support S2 or Zstd compression via pkg/store/compress.
fido has been exhaustively tested for performance using gocachemark.
Where fido wins:
Where others win:
Much of the credit for high throughput goes to puzpuzpuz/xsync and its lock-free data structures.
Run make benchmark for full results, or see benchmarks/gocachemark_results.md.
fido uses S3-FIFO, which features three queues: small (new entries), main (promoted entries), and ghost (recently evicted keys). New items enter small; items accessed twice move to main. The ghost queue tracks evicted keys in a bloom filter to fast-track their return.
fido has been hyper-tuned for high performance, and deviates from the original paper in a handful of ways:
Apache 2.0
| Back | FazBrowse Home | New Git URL |