{"id":37195766,"url":"https://github.com/aneshas/gocask","last_synced_at":"2026-01-14T22:45:49.076Z","repository":{"id":61623673,"uuid":"533027277","full_name":"aneshas/gocask","owner":"aneshas","description":"Go implementation of Bitcask - A Log-Structured Hash Table for Fast Key / Value Data","archived":false,"fork":false,"pushed_at":"2024-02-14T15:51:02.000Z","size":366,"stargazers_count":33,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2024-06-20T03:46:54.397Z","etag":null,"topics":["database","embedded","golang","key-value"],"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/aneshas.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-05T19:06:43.000Z","updated_at":"2024-06-14T18:33:44.000Z","dependencies_parsed_at":"2024-06-20T03:02:14.390Z","dependency_job_id":"1289f767-e039-4045-a148-fc39688fe0c5","html_url":"https://github.com/aneshas/gocask","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/aneshas/gocask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneshas%2Fgocask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneshas%2Fgocask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneshas%2Fgocask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneshas%2Fgocask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aneshas","download_url":"https://codeload.github.com/aneshas/gocask/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aneshas%2Fgocask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["database","embedded","golang","key-value"],"created_at":"2026-01-14T22:45:48.341Z","updated_at":"2026-01-14T22:45:49.056Z","avatar_url":"https://github.com/aneshas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoCask\n[![Go Test](https://github.com/aneshas/gocask/actions/workflows/test.yml/badge.svg)](https://github.com/aneshas/gocask/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/aneshas/gocask/badge.svg?branch=trunk)](https://coveralls.io/github/aneshas/gocask?branch=trunk)\n[![Go Report Card](https://goreportcard.com/badge/github.com/aneshas/gocask)](https://goreportcard.com/report/github.com/aneshas/gocask)\n[![Go Reference](https://pkg.go.dev/badge/github.com/aneshas/gocask.svg)](https://pkg.go.dev/github.com/aneshas/gocask)\n\nGo implementation of Bitcask - A Log-Structured Hash Table for Fast Key / Value Data as defined per [this](https://riak.com/assets/bitcask-intro.pdf) paper and with help from [this](https://github.com/avinassh/py-caskdb) repo.\n\nA learning venture into database development.\nSpecial thanks go to the amazing [Ben Johnson](https://medium.com/@benbjohnson) for pointing me in the right direction and being as helpful as he was.\n\n# Features\n- Low latency per item read or written\n- High throughput, especially when writing an incoming stream of random items\n- Ability to handle datasets much larger than RAM w/o degradation\n- Crash friendliness, both in terms of fast recovery and not losing data\n- Ease of backup and restore\n- A relatively simple, understandable (and thus supportable) code structure and data format\n- Predictable behavior under heavy access load or large volume\n- Data files are rotated based on the user defined data file size (2GB default)\n- A license that allowed for easy use\n- Data corruption crc check\n\n# Important notes\n- GoCask does not implement any buffer cache in-memory. Instead, it depends on the filesystem’s cache. Adjusting the caching characteristics of your filesystem can impact performance.\n- GoCask stores all keys in memory which means that your system needs to have enough RAM to store all of your keyspace\n\n# How to Use/Run\nThere are two ways to use gocask\n\n## Using gocask as a library (embedded db) in your own app \nGoCask can be used similarly to bolt or badger as an embedded db.\n\n`go get github.com/aneshas/gocask/cmd/gocask` and use the api. See the [docs](https://pkg.go.dev/github.com/aneshas/gocask#readme-gocask) \n\n## Running as a standalone process\nIf you have go installed:\n- `go install github.com/aneshas/gocask/cmd/gocask@latest`\n- `go install github.com/aneshas/gocask/cmd/gccli@latest`\n\n### Run db server\nThen run `gocask` which will run the db engine itself, open `default` db and start grpc (twirp) server on `localhost:8888` (Run `gocask -help` to see config options and the defaults)\n\n### Interact with server via cli\nWhile the server is running you can interact with it via `gccli` binary:\n- `gccli keys` - list stored keys\n- `gccli put somekey someval` - stores the key value pair\n- `gccli get somekey` - retrieves the value stored under the key\n- `gccli del somekey` - deletes the value stored under the key\n\n`gccli` is just meant as a simple probing tool, and you can generate your own client you can use the .proto definition included (or use the pre generated [go client](./rpc).\n \nIf you don't have go installed, you can go to [releases](https://github.com/aneshas/gocask/releases) download latest release and go through the same process as above.\n\n# Still to come\nSince the primary motivation for this repo was learning more about how db engines work and although it could already be used, it's far from production ready. With that being said, I do plan to maintain and extend it in the future.\n\nSome things that are on my mind:\n- Support for multiple processes and write locking\n- Current key deletion is a soft delete (implement merging and hint files)\n- key durability/expiry\n- Fold over keys\n- Double down on tests (fuzz?)\n- Add benchmarks\n- Make it distributed \n- An [eventstore](https://github.com/aneshas/eventstore) spin off (use gocask instead of sqlite)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faneshas%2Fgocask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faneshas%2Fgocask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faneshas%2Fgocask/lists"}