fastcache alternatives and similar packages
Based on the "Database" category.
Alternatively, view fastcache alternatives based on common mentions on social networks and blogs.
prometheus10.0 9.8 fastcache VS prometheusThe Prometheus monitoring system and time series database.
tidb9.9 10.0 fastcache VS tidbTiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial
cockroach9.9 10.0 fastcache VS cockroachCockroachDB - the open source, cloud-native distributed SQL database.
influxdb9.9 9.4 fastcache VS influxdbScalable datastore for metrics, events, and real-time analytics
dgraph9.8 3.7 fastcache VS dgraphNative GraphQL Database with graph backend
vitess9.8 9.9 fastcache VS vitessVitess is a database clustering system for horizontal scaling of MySQL.
Milvus9.8 9.9 fastcache VS MilvusA cloud-native vector database with high-performance and high scalability.
bolt9.8 0.0 fastcache VS boltA low-level key/value database for Go.
jaeger9.8 8.9 fastcache VS jaegerCNCF Jaeger, a Distributed Tracing Platform
dolt9.7 10.0 fastcache VS doltDolt – Git for Data
groupcache9.7 0.0 fastcache VS groupcachegroupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases.
badger9.7 8.0 fastcache VS badgerFast key-value DB in Go.
TinyGo9.7 9.1 fastcache VS TinyGoGo compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
rqlite9.7 8.1 fastcache VS rqliteThe lightweight, distributed relational database built on SQLite
migrate9.6 7.0 fastcache VS migrateDatabase migrations. CLI and Golang library.
kingshard9.5 0.0 fastcache VS kingshardA high-performance MySQL proxy
pgweb9.5 6.0 fastcache VS pgwebCross-platform client for PostgreSQL databases
noms9.5 1.9 fastcache VS nomsThe versioned, forkable, syncable database
Tile389.5 5.8 fastcache VS Tile38Real-time Geospatial and Geofencing
VictoriaMetrics9.5 9.9 fastcache VS VictoriaMetricsVictoriaMetrics: fast, cost-effective monitoring solution and time series database
immudb9.4 9.5 fastcache VS immudbimmudb - immutable database based on zero trust, SQL and Key-Value, tamperproof, data change history
sqlc9.4 8.6 fastcache VS sqlcGenerate type-safe code from SQL
go-cache9.4 0.0 fastcache VS go-cacheAn in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications.
goleveldb9.3 6.4 fastcache VS goleveldbLevelDB key/value database in Go.
BigCache9.3 6.7 fastcache VS BigCacheEfficient cache for gigabytes of data written in Go.
bbolt9.3 0.0 fastcache VS bboltAn embedded key/value database for Go.
dtm9.3 9.8 fastcache VS dtm此仓库应常青藤爸爸要求，已停止维护，请移步 https://github.com/dtm-labs/dtf
go-mysql9.2 7.3 fastcache VS go-mysqla powerful mysql toolset with Go
Squirrel9.2 1.7 fastcache VS SquirrelFluent SQL generation for golang
bytebase9.1 9.8 fastcache VS bytebaseDatabase CI/CD for DevOps teams. https://www.bytebase.com
go-mysql-elasticsearchSync MySQL data into elasticsearch
ledisdb9.0 0.0 fastcache VS ledisdbA high performance NoSQL Database Server powered by Go
buntdb9.0 3.1 fastcache VS buntdbBuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support
pREST8.9 4.2 fastcache VS pRESTPostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new
rosedb8.9 9.0 fastcache VS rosedb🚀 A high performance NoSQL database based on bitcask, supports string, list, hash, set, and sorted set.
go-memdb8.8 0.0 fastcache VS go-memdbGolang in-memory database built on immutable radix trees
xo8.8 3.7 fastcache VS xoCommand line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server
dbmate8.7 3.5 fastcache VS dbmate:rocket: A lightweight, framework-agnostic database migration tool.
tiedot8.7 0.9 fastcache VS tiedotA rudimentary implementation of a basic document (NoSQL) database in Go
sql-migrate8.6 4.2 fastcache VS sql-migrateSQL schema migration tool for Go.
nutsdb8.6 8.6 fastcache VS nutsdbA simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set.
cache2go8.5 3.3 fastcache VS cache2goConcurrency-safe Go caching library with expiration capabilities and access counters
GCache8.5 0.0 fastcache VS GCacheAn in-memory cache library for golang. It supports multiple eviction policies: LRU, LFU, ARC
atlas8.4 0.0 fastcache VS atlasA modern tool for managing database schemas
gocraft/dbr (database records)Additions to Go's database/sql for super fast performance and convenience.
goqu8.1 0.0 fastcache VS goquSQL builder and query library for golang
gendry8.0 0.0 fastcache VS gendrya golang library for sql builder
CovenantSQL8.0 0.0 fastcache VS CovenantSQLA decentralized, trusted, high performance, SQL database with blockchain features
chproxy7.8 7.6 fastcache VS chproxyOpen-Source ClickHouse http proxy and load balancer
diskv7.7 0.0 fastcache VS diskvA disk-backed key-value store.
Static code analysis for 29 languages.
Do you think we are missing an alternative of fastcache or a related project?
fastcache - fast thread-safe inmemory cache for big number of entries in Go
- Fast. Performance scales on multi-core CPUs. See benchmark results below.
- Thread-safe. Concurrent goroutines may read and write into a single cache instance.
- The fastcache is designed for storing big number of entries without GC overhead.
- Fastcache automatically evicts old entries when reaching the maximum cache size set on its creation.
- Simple API.
- Simple source code.
- Cache may be saved to file and loaded from file.
- Works on Google AppEngine.
Fastcache performance is compared with BigCache, standard Go map
GOMAXPROCS=4 go test github.com/VictoriaMetrics/fastcache -bench='Set|Get' -benchtime=10s goos: linux goarch: amd64 pkg: github.com/VictoriaMetrics/fastcache BenchmarkBigCacheSet-4 2000 10566656 ns/op 6.20 MB/s 4660369 B/op 6 allocs/op BenchmarkBigCacheGet-4 2000 6902694 ns/op 9.49 MB/s 684169 B/op 131076 allocs/op BenchmarkBigCacheSetGet-4 1000 17579118 ns/op 7.46 MB/s 5046744 B/op 131083 allocs/op BenchmarkCacheSet-4 5000 3808874 ns/op 17.21 MB/s 1142 B/op 2 allocs/op BenchmarkCacheGet-4 5000 3293849 ns/op 19.90 MB/s 1140 B/op 2 allocs/op BenchmarkCacheSetGet-4 2000 8456061 ns/op 15.50 MB/s 2857 B/op 5 allocs/op BenchmarkStdMapSet-4 2000 10559382 ns/op 6.21 MB/s 268413 B/op 65537 allocs/op BenchmarkStdMapGet-4 5000 2687404 ns/op 24.39 MB/s 2558 B/op 13 allocs/op BenchmarkStdMapSetGet-4 100 154641257 ns/op 0.85 MB/s 387405 B/op 65558 allocs/op BenchmarkSyncMapSet-4 500 24703219 ns/op 2.65 MB/s 3426543 B/op 262411 allocs/op BenchmarkSyncMapGet-4 5000 2265892 ns/op 28.92 MB/s 2545 B/op 79 allocs/op BenchmarkSyncMapSetGet-4 1000 14595535 ns/op 8.98 MB/s 3417190 B/op 262277 allocs/op
MB/s column here actually means
millions of operations per second.
As you can see,
fastcache is faster than the
BigCache in all the cases.
fastcache is faster than the standard Go map and
sync.Map on workloads
- Keys and values must be byte slices. Other types must be marshaled before storing them in the cache.
- Big entries with sizes exceeding 64KB must be stored via distinct API.
- There is no cache expiration. Entries are evicted from the cache only on cache size overflow. Entry deadline may be stored inside the value in order to implement cache expiration.
The cache uses ideas from BigCache:
- The cache consists of many buckets, each with its own lock. This helps scaling the performance on multi-core CPUs, since multiple CPUs may concurrently access distinct buckets.
- Each bucket consists of a
hash(key) -> (key, value) positionmap and 64KB-sized byte slices (chunks) holding encoded
(key, value)entries. Each bucket contains only
O(chunksCount)pointers. For instance, 64GB cache would contain ~1M pointers, while similarly-sized
map[string]bytewould contain ~1B pointers for short keys and values. This would lead to huge GC overhead.
64KB-sized chunks reduce memory fragmentation and the total memory usage comparing
to a single big chunk per bucket.
Chunks are allocated off-heap if possible. This reduces total memory usage because
GC collects unused memory more frequently without the need in
Fastcachehas been extracted from VictoriaMetrics sources. See this article for more info about
What is the difference between
fastcache and other similar caches like BigCache or FreeCache?
Fastcacheis faster. See benchmark results above.
Fastcacheuses less memory due to lower heap fragmentation. This allows saving many GBs of memory on multi-GB caches.
FastcacheAPI is simpler. The API is designed to be used in zero-allocation mode.
fastcache doesn't support cache expiration?
Because we don't need cache expiration in VictoriaMetrics.
Cached entries inside
VictoriaMetrics never expire. They are automatically evicted on cache size overflow.
It is easy to implement cache expiration on top of
fastcache by caching values
with marshaled deadlines and verifying deadlines after reading these values
from the cache.
fastcache doesn't support advanced features such as thundering herd protection or callbacks on entries' eviction?
Because these features would complicate the code and would make it slower.
Fastcache source code is simple - just copy-paste it and implement the feature you want
on top of it.