{"id":21121442,"url":"https://github.com/oneofone/jdb","last_synced_at":"2025-10-25T01:13:13.609Z","repository":{"id":57528291,"uuid":"62274920","full_name":"OneOfOne/jdb","owner":"OneOfOne","description":"A file-backed ACID in-memory k/v data store.","archived":false,"fork":false,"pushed_at":"2016-07-09T22:28:41.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T11:25:18.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OneOfOne.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}},"created_at":"2016-06-30T03:03:03.000Z","updated_at":"2024-02-21T10:09:46.000Z","dependencies_parsed_at":"2022-08-30T11:50:20.831Z","dependency_job_id":null,"html_url":"https://github.com/OneOfOne/jdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OneOfOne/jdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneOfOne%2Fjdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneOfOne%2Fjdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneOfOne%2Fjdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneOfOne%2Fjdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OneOfOne","download_url":"https://codeload.github.com/OneOfOne/jdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneOfOne%2Fjdb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263421917,"owners_count":23464048,"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":[],"created_at":"2024-11-20T03:50:18.830Z","updated_at":"2025-10-25T01:13:08.576Z","avatar_url":"https://github.com/OneOfOne.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jdb [![MIT licensed](https://img.shields.io/badge/license-apache-blue.svg)](https://raw.githubusercontent.com/OneOfOne/jdb/master/LICENSE) ![Status](https://img.shields.io/badge/status-beta-red.svg)\n\n**A file-backed ACID in-memory k/v data store.**\n\n## FAQ\n\n### Why would I use this over bolt or any other K/V store?\n\n1. The data is always in memory, in a very simple memory layout and it is extremely fast.\n2. You can specify the on-disk file format, the default is JSON, however\nit is very easy to add your own.\n3. You can use the values directly in your code without having to copy them*\n4. You can fully replay the database and discard transactions as needed (not implemented yet).\n\n* *modifying values without a copy can result in a race, but the on-disk data won't be corrupted.*\n* *compacting the database will remove older transactions.*\n\n### Why shouldn't I use this?\n\nMainly if your dataset doesn't fit in memory then you're better off with\nan mmap'ed k/v store like the excellent [boltdb](https://github.com/boltdb/bolt).\n\n## Benchmarks\n\n```\n➤ go test -benchmem -bench=.  -v  -benchtime=3s\n=== RUN   TestDB\n--- PASS: TestDB (0.00s)\n=== RUN   TestCryptoBackend\n--- PASS: TestCryptoBackend (0.00s)\nBenchmarkJDBSameTxReadWriteJSON-8               2000000     2898 ns/op             312 B/op         10 allocs/op\nBenchmarkJDBSameTxReadWriteGzipJSON-8           2000000     3027 ns/op             312 B/op         10 allocs/op\nBenchmarkJDBSameTxReadWriteCryptoJSON-8         1000000     3077 ns/op             312 B/op         10 allocs/op\nBenchmarkJDBSameTxReadWriteCryptoGzipJSON-8     2000000     2908 ns/op             312 B/op         10 allocs/op\n\nBenchmarkBoltSameTxReadWrite-8                   500000     8682 ns/op            6309 B/op         44 allocs/op\n\nBenchmarkJDBSeparateReadWriteJSON-8             1000000     3000 ns/op             312 B/op         10 allocs/op\nBenchmarkJDBSeparateReadWriteGzipJSON-8         1000000     3014 ns/op             312 B/op         10 allocs/op\nBenchmarkJDBSeparateReadWriteCryptoJSON-8       2000000     3020 ns/op             312 B/op         10 allocs/op\nBenchmarkJDBSeparateReadWriteCryptoGzipJSON-8   1000000     3000 ns/op             312 B/op         10 allocs/op\n\nBenchmarkBoltSeparateReadWrite-8                 500000    16040 ns/op           12416 B/op         53 allocs/op\n\nPASS\nok      github.com/OneOfOne/jdb 60.457s\n\n```\n\n## Examples\n\n```go\n//db, err := jdb.New(fp, \u0026Opts{Backend: GZipJSONBackend})\ndb, err := jdb.New(\"db.jdb\", nil) // default JSONBackend\nif err != nil {\n\tlog.Panic(err)\n}\n\ndefer db.Close()\n\nerr := db.Update(func(tx *Tx) error {\n\treturn tx.Set(\"a\", []byte(\"a\")) // or\n\t// return tx.Set(\"a\", jdb.Value(\"a\"))\n})\n\n// shorthand for a single\nerr := db.SetObject(\"map in a sub-bucket\", map[string]bool{\n\t\"isCool\": true,\n}, \"parent bucket\", \"a bucket under the parent bucket\")\n```\n\n## TODO\n\n* Replay / Filter support.\n* Per-bucket unique ID generation.\n* Archiving support.\n\n## License\n\nApache v2.0 (see [LICENSE](https://raw.githubusercontent.com/OneOfOne/jdb/master/LICENSE) file).\n\nCopyright 2016-2016 Ahmed \u003c[OneOfOne](https://github.com/OneOfOne/)\u003e W.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneofone%2Fjdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foneofone%2Fjdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneofone%2Fjdb/lists"}