{"id":16179675,"url":"https://github.com/mivinci/mc","last_synced_at":"2026-05-01T03:31:29.456Z","repository":{"id":64302262,"uuid":"328593416","full_name":"mivinci/mc","owner":"mivinci","description":"A simple distributed caching database for learning purposes.","archived":false,"fork":false,"pushed_at":"2021-01-12T12:09:06.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T21:47:00.824Z","etag":null,"topics":["cache","cache-database","cluster","command-line-tool","golang","in-memory-caching","lru-cache","rpc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mivinci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-11T08:16:06.000Z","updated_at":"2022-10-25T12:32:14.000Z","dependencies_parsed_at":"2023-01-15T09:45:40.022Z","dependency_job_id":null,"html_url":"https://github.com/mivinci/mc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mivinci/mc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivinci%2Fmc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivinci%2Fmc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivinci%2Fmc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivinci%2Fmc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mivinci","download_url":"https://codeload.github.com/mivinci/mc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mivinci%2Fmc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32484352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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","cache-database","cluster","command-line-tool","golang","in-memory-caching","lru-cache","rpc"],"created_at":"2024-10-10T05:43:45.099Z","updated_at":"2026-05-01T03:31:29.442Z","avatar_url":"https://github.com/mivinci.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MC\nMC - short for Memory Cache - is a simple distributed caching server for learning purpose.\n\n## Features\n\n- In memory LRU cache\n- RPC transport\n- Cluster\n- Command line client\n- Go client\n\nSo far, MC has only `get`, `add` and `remove` of caching and a Consistent Hash Algorithm will be considered to use for the scalability in the future.\n\n## Usage\n\n### Install\n\n```bash\ngo get github.com/mivinci/mc\n```\n\nOr (not available yet)\n\n```bash\ndocker pull mivinci/mc\n```\n\nOr [download](https://github.com/Mivinci/mc/tags) the pre-build version for macOS or Windows.\n\n### Run\n\n`mc` can be run either a server or a client.\n\n#### Run an MC server.\n\n```\nmc -server\n```\n\nBy default, MC chooses `127.0.0.1:8000` to serve on, or you can decide the address by providing a `-address` parameter.\n\n```\nmc -server -address 127.0.0.1:8001\n```\n\nfor short\n\n```\nmc -server -address :8001\n```\n\nYou can customize the maximum caching size for a single MC server.\n\n```\nmc -server -c 128\n```\n\n#### Run an MC client.\n\n```\nmc -client\n```\n\nAlso, the MC client chooses `127.0.0.1:8000` to dial during usage. You can provide an `-address` parameter to the MC client to communicate with a different address.\n\n#### Use Cluster\n\nOnce you have run multiple MC servers, you can communicate with them simply by using the MC client with multiple addresses seperated by commas.\n\n```\nmc -client -address 1.1.1.1:8000,1.1.1.2:8001,1.1.1.3:8002\n```\n\nThe MC command line  client will lead you to an interface like this.\n\n```\n$ mc -client\nMC v1.0.0, press [ctrl c] to exit.\n127.0.0.1:8000\u003e get name\nXJJ\n127.0.0.1:8000\u003e remove name\n127.0.0.1:8000\u003e get name\nnil\n```\n\n### Go Client\n\n```go\nimport \"github.com/mivinci/mc\"\n```\n\n#### Add\n\n```go\nr := mc.Add(\"name\", []byte(\"XJJ\"))\n```\n\n#### Get\n\n```go\nr := mc.Get(\"name\")\n```\n\n#### Remove\n\n```go\nr := mc.Remove(\"name\")\n```\n\n#### Cluster\n\n```go\nclient := mc.NewClient(\"1.1.1.1:8000\", \"1.1.1.2:8001\", \"1.1.1.3:8000\")\nr := client.Get(\"name\")\n...\n```\n\n## About\n\nThanks to the projects and videos below for the inspiration.\n\n- [https://github.com/asim/mq](https://github.com/asim/mq)\n\n- [https://www.youtube.com/watch?v=iuqZvajTOyA](https://www.youtube.com/watch?v=iuqZvajTOyA)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmivinci%2Fmc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmivinci%2Fmc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmivinci%2Fmc/lists"}