Sitemap

Fast Golang API Performance with In Memory Key Value Storing Cache

4 min readJan 9, 2021

--

Press enter or click to view image in full size
Image credits to Guillaume Jaillet (https://unsplash.com/photos/Nl-GCtizDHg)

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

go-cache is an in-memory key:value store/cache similar to memcached that is suitable for applications running on a single machine. Its major advantage is that, being essentially a thread-safe map[string]interface{} with expiration times, it doesn't need to serialize or transmit its contents over the network.

Any object can be stored, for a given duration or forever, and the cache can be safely used by multiple goroutines.

Press enter or click to view image in full size
App Cache is the Go-Cache
Press enter or click to view image in full size
Values are in ms (milliseconds)

--

--