{"id":33179248,"url":"https://github.com/godcrampy/fireflydb","last_synced_at":"2026-01-17T18:47:44.024Z","repository":{"id":220872720,"uuid":"735572466","full_name":"godcrampy/fireflydb","owner":"godcrampy","description":"FireflyDB is a fast, thread-safe, JVM-based key-value storage engine with microsecond latency.","archived":false,"fork":false,"pushed_at":"2024-02-04T21:24:57.000Z","size":98,"stargazers_count":34,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-02-05T22:55:35.637Z","etag":null,"topics":["database","java","storage-engine"],"latest_commit_sha":null,"homepage":"","language":"Java","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/godcrampy.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}},"created_at":"2023-12-25T11:59:21.000Z","updated_at":"2024-02-05T21:10:42.000Z","dependencies_parsed_at":"2024-02-04T23:03:54.299Z","dependency_job_id":null,"html_url":"https://github.com/godcrampy/fireflydb","commit_stats":null,"previous_names":["godcrampy/fireflydb"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/godcrampy/fireflydb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godcrampy%2Ffireflydb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godcrampy%2Ffireflydb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godcrampy%2Ffireflydb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godcrampy%2Ffireflydb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/godcrampy","download_url":"https://codeload.github.com/godcrampy/fireflydb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/godcrampy%2Ffireflydb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28516258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:28:00.501Z","status":"ssl_error","status_checked_at":"2026-01-17T18:28:00.150Z","response_time":85,"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","java","storage-engine"],"created_at":"2025-11-16T03:00:36.827Z","updated_at":"2026-01-17T18:47:44.015Z","avatar_url":"https://github.com/godcrampy.png","language":"Java","funding_links":[],"categories":["数据库"],"sub_categories":[],"readme":"# FireflyDB\n\nFireflyDB is a fast, thread-safe, JVM-based key-value storage engine with microsecond latency. FireflyDB is 20x faster\nfor reads and 10x faster for writes than [Bitcask](https://github.com/basho/bitcask), which has a similar architecture.\n\nFireflyDB is hash-based and gives up range queries to achieve high throughput and low latency. As a result, it is about\n100x faster at writes than [LevelDB](https://github.com/google/leveldb) (Google)\nand [RocksDB](https://github.com/facebook/rocksdb) (Facebook).\n\nFireflyDB relies on sensible defaults and does not expose many configuration options. FireflyDB is designed with\neducated tradeoffs to achieve high performance:\n\n1. All the keys must fit in memory. This is a tradeoff with all hash-based storage engines. Even with the largest key\n   size of 32KB, FireflyDB can store 32,000+ keys per 1GB of memory.\n2. FireflyDB does not support range queries.\n3. Maximum key size is 32768 bytes or 32KB.\n4. Maximum value size is 2,147,483,647 bytes or 2.14 GB.\n\n## Installation\n\n### Maven\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.sahilbondre\u003c/groupId\u003e\n    \u003cartifactId\u003efireflydb\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n\n```gradle\nimplementation 'com.sahilbondre:fireflydb:0.1.1'\n```\n\n## API\n\n```java\nFireflyDB fireflyDB=FireflyDB.getInstance(\"path/to/db\");\n    fireflyDB.start();\n\n// Write\n    byte[]key=\"testKey\".getBytes();\n    byte[]value=\"testValue\".getBytes();\n\n    fireflyDB.put(key,value);\n\n// Read\n    byte[]result=fireflyDB.get(key);\n\n// Compaction \n// FireflyDB will compact automatically but can be triggered on demand.\n    fireflyDB.compact();\n\n    fireflyDB.stop();\n```\n\n## Benchmarks\n\n```\niterations: 100,000\ncpu: 1\nmemory: 1GB\nkey-size: 8 bytes\nvalue-size: 100 bytes\n```\n\n### Random Write Test\n\nTest: Generate a random key and value and write it to the database.\n\n![write-test](./docs/write-test.png)\n\n| Database  | Avg Time (microseconds) | P90 Latency (microseconds) |\n|-----------|-------------------------|----------------------------|\n| In-Memory | 0.53                    | 1                          |\n| LevelDB   | 445.94                  | 811                        |\n| Bitcask   | 71.33                   | 48                         |\n| RocksDB   | 568.60                  | 872                        |\n| FireflyDB | 7.10                    | 5                          |\n\n### Random Read Test\n\nTest: Pick a random key from the ones written in the previous test and read it from the database.\n\n![read-test](./docs/read-test.png)\n\n| Database  | Avg Time (microseconds) | P90 Latency (microseconds) |\n|-----------|-------------------------|----------------------------|\n| In-Memory | 0.49                    | 1                          |\n| LevelDB   | 1.55                    | 2                          |\n| Bitcask   | 108.03                  | 62                         |\n| RocksDB   | 0.94                    | 2                          |\n| FireflyDB | 4.97                    | 4                          |\n\n### Alternating Read-Write Test\n\nTest: Perform a read and write operation alternately.\n\n![alternating-read-write-test](./docs/rw-test.png)\n\n| Database          | Avg Time (microseconds) | P90 Latency (microseconds) |\n|-------------------|-------------------------|----------------------------|\n| In-Memory (read)  | 0.61                    | 1                          |\n| In-Memory (write) | 0.57                    | 1                          |\n| LevelDB (read)    | 3.43                    | 5                          |\n| LevelDB (write)   | 441.38                  | 814                        |\n| Bitcask (read)    | 120.15                  | 60                         |\n| Bitcask (write)   | 66.78                   | 57                         |\n| RocksDB (read)    | 4.54                    | 7                          |\n| RocksDB (write)   | 567.14                  | 971                        |\n| FireflyDB (read)  | 3.89                    | 4                          |\n| FireflyDB (write) | 3.91                    | 4                          |\n\n## Potential Improvements\n\n- [ ] Add an explicit delete operation.\n- [ ] Expose compaction size as a configuration option.\n- [ ] Expose compaction interval as a configuration option.\n- [ ] Allow larger key size as a configuration option.\n- [ ] Expose read only mode.\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first\nto discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[Apache 2.0](https://raw.githubusercontent.com/godcrampy/fireflydb/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodcrampy%2Ffireflydb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgodcrampy%2Ffireflydb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgodcrampy%2Ffireflydb/lists"}