{"id":16920551,"url":"https://github.com/arriqaaq/zizou","last_synced_at":"2025-07-14T08:04:43.672Z","repository":{"id":98675751,"uuid":"143302539","full_name":"arriqaaq/zizou","owner":"arriqaaq","description":"In memory sharded cache implementation","archived":false,"fork":false,"pushed_at":"2021-06-26T11:14:54.000Z","size":14,"stargazers_count":34,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T06:33:05.554Z","etag":null,"topics":["cache","go","inmem-cache","sharded"],"latest_commit_sha":null,"homepage":"https://medium.com/@arriqaaq/latency-need-not-always-require-scaling-your-microservice-a-story-of-an-in-memory-cache-384419174ef3","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arriqaaq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-02T14:02:04.000Z","updated_at":"2025-03-29T12:28:42.000Z","dependencies_parsed_at":"2023-04-14T01:47:14.790Z","dependency_job_id":null,"html_url":"https://github.com/arriqaaq/zizou","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/arriqaaq/zizou","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arriqaaq%2Fzizou","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arriqaaq%2Fzizou/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arriqaaq%2Fzizou/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arriqaaq%2Fzizou/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arriqaaq","download_url":"https://codeload.github.com/arriqaaq/zizou/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arriqaaq%2Fzizou/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262215,"owners_count":23736407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","go","inmem-cache","sharded"],"created_at":"2024-10-13T19:48:43.230Z","updated_at":"2025-07-14T08:04:43.609Z","avatar_url":"https://github.com/arriqaaq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zizou\nIn memory cache implementation with high concurrency\n\n\n\n\n## Features\n\n* Store millions of entries\n* High concurrent thread-safe access\n* Expiration support\n* Shard support to avoid locks on whole db during any concurrent read/writes/deletes\n\n## Example Usage\n\n```go\nconfig:=zizou.Config{\n\tSweepTime:10*time.Minute,\n\tShardSize: 256,\n}\ncache,err:=zizou.New(\u0026config)\ncache.Set(\"foo\", \"bar\", 10*time.Second)\nitem, found := cache.Get(\"foo\")\n```\n\n\n\n## Performance\n\n```bash\n\t\tBenchmarkCacheGetExpiring-4                \t20000000\t        70.0 ns/op\n\t\tBenchmarkCacheGetNotExpiring-4             \t20000000\t       119 ns/op\n\t\tBenchmarkCacheGetConcurrentExpiring-4      \t20000000\t        59.3 ns/op\n\t\tBenchmarkCacheGetConcurrentNotExpiring-4   \t20000000\t        91.3 ns/op\n\t\tBenchmarkCacheSetExpiring-4                \t10000000\t       172 ns/op\n\t\tBenchmarkCacheSetNotExpiring-4             \t10000000\t       134 ns/op\n\t\tBenchmarkCacheSetDelete-4                  \t 5000000\t       343 ns/op\n```\n\n\n## TODO\n\n- Store data as a map of string and byte array to avoid lookups on object, which will be copied in memory\n- Make a circular shard ring, cache objects in individual shard for better concurrency and to avoid locks on the whole cache map object (LRU implementation)\n- Use eviction policies of key using a list object, evict those at front\n- Implement operations using cmdable interface as done in go-redis(design pattern)\n- Check how GC can be avoided \n\nZizou Image source: https://www.pinterest.ca/pin/436075176391410672/?lp=true\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farriqaaq%2Fzizou","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farriqaaq%2Fzizou","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farriqaaq%2Fzizou/lists"}