{"id":30351641,"url":"https://github.com/phyulwin/replicated-in-memory-cache-golang","last_synced_at":"2026-04-12T16:04:28.255Z","repository":{"id":309284343,"uuid":"1035694823","full_name":"phyulwin/replicated-in-memory-cache-golang","owner":"phyulwin","description":"This project is a replicated in-memory key/value cache written in Go.","archived":false,"fork":false,"pushed_at":"2025-08-11T00:59:31.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-11T02:36:15.073Z","etag":null,"topics":["cache-server","concurrency","distributed-systems","docker","golang","inmemory-cache","keyvaluestore","replication"],"latest_commit_sha":null,"homepage":"","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/phyulwin.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,"zenodo":null}},"created_at":"2025-08-11T00:06:18.000Z","updated_at":"2025-08-11T01:02:15.000Z","dependencies_parsed_at":"2025-08-11T02:36:23.768Z","dependency_job_id":"3e81be71-2e1e-4347-b3b4-adb76f07f82f","html_url":"https://github.com/phyulwin/replicated-in-memory-cache-golang","commit_stats":null,"previous_names":["phyulwin/replicated-in-memory-cache-golang"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/phyulwin/replicated-in-memory-cache-golang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phyulwin%2Freplicated-in-memory-cache-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phyulwin%2Freplicated-in-memory-cache-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phyulwin%2Freplicated-in-memory-cache-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phyulwin%2Freplicated-in-memory-cache-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phyulwin","download_url":"https://codeload.github.com/phyulwin/replicated-in-memory-cache-golang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phyulwin%2Freplicated-in-memory-cache-golang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271073387,"owners_count":24694538,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-server","concurrency","distributed-systems","docker","golang","inmemory-cache","keyvaluestore","replication"],"created_at":"2025-08-18T23:11:04.968Z","updated_at":"2026-04-12T16:04:28.221Z","avatar_url":"https://github.com/phyulwin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Replicated In-Memory Cache (Go)\n\nThis project is a replicated in-memory key/value cache written in Go. It supports running on multiple nodes, replicates data between them (eventual consistency), and provides fast local reads across distributed servers.\n\n## Features\n- Replicated in-memory cach\n- Fast local reads, distributed writes\n- HTTP/JSON API for clients and peers\n- Thread-safe, concurrent map\n- Last-write-wins conflict resolution\n- Key TTL and automatic expiration\n- Peer health checks\n- CLI client\n- Docker and docker-compose support\n- Unit and integration tests\n\n## Tech Stack\n- Go (concurrency, HTTP server, sync primitives)\n- net/http, sync, time, context, encoding/json (stdlib)\n- Docker, docker-compose\n\n## Getting Started\n\n### Build \u0026 Test\n```sh\n# Run tests from the repo root\ngo test ./...\n\n# Build the node and the client\ngo build -o bin/cache-node ./cmd/cache-node\ngo build -o bin/cachectl   ./cmd/cachectl\n```\n\n### Run a 3-Node Cluster (Manually)\nOpen three terminals and run:\n```sh\n# Terminal 1\n./bin/cache-node -addr=:8081 -peers=http://localhost:8082,http://localhost:8083\n\n# Terminal 2\n./bin/cache-node -addr=:8082 -peers=http://localhost:8081,http://localhost:8083\n\n# Terminal 3\n./bin/cache-node -addr=:8083 -peers=http://localhost:8081,http://localhost:8082\n```\n\n### Use the CLI\n```sh\n# Set a value with TTL and wait for 2 peers to acknowledge\n./bin/cachectl -server http://localhost:8081 set greeting \"hello world\" -ttl=30s -min=2\n\n# Get the value from a different node\n./bin/cachectl -server http://localhost:8083 get greeting\n# -\u003e hello world\n\n# Delete everywhere (full replication)\n./bin/cachectl -server http://localhost:8082 del greeting -full\n```\n\n### Build Docker Images\n\n```sh\n# Build server image\ndocker build -t rc-node --target node .\n\n# Build CLI image\ndocker build -t rc-cli --target cli .\n```\n\n### Run with Docker Compose\n\n```sh\ndocker-compose up --build\n```\n\n---\n\n**Author:** Phyu Lwin | **Last Updated:** Aug 10th, 2025","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphyulwin%2Freplicated-in-memory-cache-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphyulwin%2Freplicated-in-memory-cache-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphyulwin%2Freplicated-in-memory-cache-golang/lists"}