{"repo":"seaguest/cache","free":true,"listed":false,"github":"https://github.com/seaguest/cache","clone":"git clone https://github.com/seaguest/cache.git","description":"A lightweight high-performance distributed two-level cache (in-memory + redis) with loader function library for Go.","language":"Go","stars":154,"topics":["cache","redis","distributed","cache-aside"],"license":"MIT","category":"databases-storage","readme_excerpt":"cache This is a high-performance, lightweight distributed caching solution that implements the cache-aside pattern, built upon a combination of in-memory and Redis. The cache architecture includes a singular global Redis instance and multiple in-memory instances. Data changes can be synchronized across all in-memory cache instances depending on the cache update policy. The library's design gives priority to data retrieval from the in-memory cache first. If the data isn't found in the local memory cache, it then resorts to the Redis cache. Should the data be unavailable in both caches, the library invokes a loader function to fetch the data, storing it in the cache for future access, thus ensuring an always-on cache. Features - Two-level cache : in-memory cache first, redis-backed - Easy to use : simple api with minimum configuration. - Data consistency : all in-memory instances will be notified by Pub-Sub if any value gets deleted, other in-memory instances will update. - Concurrency : singleflight is used to avoid cache breakdown. - Metrics : provide callback function to measure the cache metrics. Sequence diagram cache get policy - GetPolicyReturnExpired: return found object even if it has expired. - GetPolicyReloadOnExpiry: reload object if found object has expired, then return. The below sequence diagrams have GetPolicyReturnExpired + UpdatePolicyBroadcast. Reload from loader function Cache GetObject Delete Installation go get -u github.com/seaguest/cache API Production I","default_branch":null,"files":null,"tree":[],"storefront":"/r/seaguest","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/seaguest/cache/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}