{"id":26221395,"url":"https://github.com/auula/wiredb","last_synced_at":"2025-04-12T20:43:53.131Z","repository":{"id":43320240,"uuid":"448509398","full_name":"auula/wiredb","owner":"auula","description":"WireDB is a NoSQL database based on Log-structured file system.","archived":false,"fork":false,"pushed_at":"2025-03-04T15:36:10.000Z","size":3642,"stargazers_count":262,"open_issues_count":0,"forks_count":32,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-04T15:39:03.698Z","etag":null,"topics":["bitcask","database","kv","kvdb","kvstore","log","log-structuredfs","nosql","nosql-database","restful-api","storage","storage-engine","storage-provider"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/auula.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-01-16T09:29:22.000Z","updated_at":"2025-03-04T15:36:14.000Z","dependencies_parsed_at":"2023-11-27T09:59:10.064Z","dependency_job_id":"7b060966-44e8-45c0-b012-7d7d5c2f145f","html_url":"https://github.com/auula/wiredb","commit_stats":null,"previous_names":["auula/kalasa","auula/classdb","vasedb/vasedb","auula/vasedb","classdb/classdb","wiredb/wiredkv","wiredb/wiredb","auula/tunadb","auula/wiredb"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auula%2Fwiredb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auula%2Fwiredb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auula%2Fwiredb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auula%2Fwiredb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auula","download_url":"https://codeload.github.com/auula/wiredb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631686,"owners_count":21136555,"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":["bitcask","database","kv","kvdb","kvstore","log","log-structuredfs","nosql","nosql-database","restful-api","storage","storage-engine","storage-provider"],"created_at":"2025-03-12T16:12:31.098Z","updated_at":"2025-04-12T20:43:53.124Z","avatar_url":"https://github.com/auula.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"cmd/wiredb-org.png\" style=\"width: 86px; height: auto; display: inline-block;\"\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003eWireDB is a NoSQL that supports multiple data types based on Log-structured file system.\u003c/p\u003e\n\n\n---\n\n\n[![Go Report Card](https://img.shields.io/badge/go%20report-A+-brightgreen.svg?style=flat)](https://img.shields.io/badge/go%20report-A+-brightgreen.svg?style=flat)\n[![Go Reference](https://pkg.go.dev/badge/github.com/auula/wiredb.svg)](https://pkg.go.dev/github.com/auula/wiredb)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/55bc449808ca4d0c80c0122f170d7313)](https://app.codacy.com/gh/auula/wiredb/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![codecov](https://codecov.io/gh/auula/wiredb/graph/badge.svg?token=xTcPzdLFkJ)](https://codecov.io/gh/auula/wiredb)\n[![DeepSource](https://app.deepsource.com/gh/auula/wiredb.svg/?label=active+issues\u0026show_trend=true\u0026token=sJBjq88ZxurlEgiOu_ukQ3O_)](https://app.deepsource.com/gh/auula/wiredb/?ref=repository-badge)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![release](https://img.shields.io/github/release/auula/wiredb.svg)](https://github.com/auula/wiredb/releases)\n\n\n\n---\n\n[简体中文](README.md) | [English](README_EN.md)\n\n---\n\n## 🎉 Feature\n\n- 支持多种内置的数据结构\n- 高吞吐量、低延迟、高效批量数据写入\n- 支持磁盘数据存储和磁盘垃圾数据回收\n- 支持磁盘数据静态加密和静态数据压缩\n- 支持 IP 白名单功能保障数据的安全访问\n- 支持通过基于 RESTful API 协议操作数据\n\n---\n\n## 🚀 Quick Start\n\n使用 Docker 可以快速部署 [`wiredb:latest`](https://hub.docker.com/r/auula/wiredb) 的镜像来测试 WireDB 提供的服务，运行以下命令即可拉取 WireDB 镜像：\n\n```bash\ndocker pull auula/wiredb:latest\n```\n\n运行 WireDB 镜像启动容器服务，并且映射端口到外部主机网络，执行下面的命令：\n\n```bash\ndocker run -p 2668:2668 auula/wiredb:latest\n```\n\nWireDB 提供使用 RESTful API 的方式进行数据交互，理论上任意具备 HTTP 协议的客户端都支持访问和操作 WireDB 服务实例。在调用 RESTful API 时需要在请求头中添加 `Auth-Token` 进行鉴权，该密钥由 WireDB 进程自动生成，可通过容器运行时日志获取，使用以下命令查看启动日志：\n\n```bash\nroot@2c2m:~# docker logs 66ae91bc73a6\n                         _            ____\n                 _    __(_)______ ___/ / /\n                | |/|/ / / __/ -_) _  / _ \\\n                |__,__/_/_/  \\__/\\_,_/_.__/  v1.1.2\n\n  WireDB is a NoSQL database based on Log-structured file system.\n  Software License: Apache 2.0  Website: https://wiredb.github.io\n\n[WIREDB:C] 2025/02/27 10:07:01 [WARN]\tThe default password is: T9EHAvi5dcIpPK9G#ADlVj4NB 👈\n[WIREDB:C] 2025/02/27 10:07:01 [INFO]\tLogging output initialized successfully\n[WIREDB:C] 2025/02/27 10:07:01 [INFO]\tLoading and parsing region data files...\n[WIREDB:C] 2025/02/27 10:07:01 [INFO]\tRegion compression activated successfully\n[WIREDB:C] 2025/02/27 10:07:01 [INFO]\tFile system setup completed successfully\n[WIREDB:C] 2025/02/27 10:07:01 [INFO]\tHTTP server started at http://172.0.0.1:2668 🚀\n```\n\n如果计划将 WireDB 作为长期运行的服务，推荐直接使用主流 Linux 发行版来运行而非容器技术。采用裸机 Linux 部署 WireDB 服务，可手动优化存储引擎参数，以获得更稳定的性能和更高的资源利用率，具体参数配置建议查看[官方文档](https://docs.wiredb.org)。\n\n---\n\n## 🕹️ RESTful API \n\n目前 WireDB 服务对外提供数据交互接口是基于 HTTP 协议的 RESTful API ，只需要通过支持  `HTTP` 协议客户端软件就可以进行数据操作。这里推荐使用 `curl` 软件进行数据交互操作，WireDB 内部提供了多种数据结构抽象，例如 Table 、List 、ZSet 、Set 、Number 、Text 类型，这些数据类型对应着常见的业务代码所需使用的数据结构，这里以 Table 类型结构为例进行 RESTful API 数据交互的演示。\n\n\nTable 结构类似于 JSON 及任何有映射关系的半结构化数据，例如编程语言中的 struct 和 class 字段都可以使用 Table 进行存储，下面是一个 Table 结构 JSON 抽象，其中的 `ttl` 字段为设置存活时间，超过 120 秒后会被主动删除：\n\n```json\n{\n    \"table\": {\n        \"is_valid\": false,\n        \"items\": [\n            {\n                \"id\": 1,\n                \"name\": \"Item 1\"\n            },\n            {\n                \"id\": 2,\n                \"name\": \"Item 2\"\n            }\n        ],\n        \"meta\": {\n            \"version\": \"2.0\",\n            \"author\": \"Leon Ding\"\n        }\n    },\n    \"ttl\": 120\n}\n```\n\n下面是 curl 进行数据存储操作的例子，由于是 RESTful API 设计风格，需要在 HTTP 的请求路径 URL 加上数据类型信息。注意存储使用 HTTP 协议的 PUT 方法进行操作，使用 PUT 方法会直接创建新数据版本覆盖掉旧的数据版本，命令如下：\n\n```bash\ncurl -X PUT http://localhost:2668/table/key-01 -v \\\n     -H \"Content-Type: application/json\" \\\n     -H \"Auth-Token: T9EHAvi5dcIpPK9G#ADlVj4NB\" \\\n     --data @tests/table.json\n```\n\n获取数据的方式只需要将 HTTP 的请求改为 GET 方式就会获取得 Key 相应的存储记录，命令如下：\n\n```bash\ncurl -X GET http://localhost:2668/table/key-01 -v \\\n-H \"Auth-Token: T9EHAvi5dcIpPK9G#ADlVj4NB\" \n```\n\n删除对应的数据记录，只需要将 HTTP 的请求改为 DELETE 的方式即可，命令如下：\n\n```bash\ncurl -X DELETE http://localhost:2668/table/key-01 -v \\\n-H \"Auth-Token: T9EHAvi5dcIpPK9G#ADlVj4NB\" \n```\n\n更为复杂的查询和复杂更新操作，将在后续的版本更新中添加支持。其他数据结构类型操作代码示例请查看[官方文档](https://docs.wiredb.org)。\n\n\n---\n\n## 🧪 Benchmark Test\n\n由于底层存储引擎是以 Append-Only Log 的方式将所有的操作写入到数据文件中，所以这里给出的测试用例报告，是针对的其核心文件系统 [`vfs`](./vfs/) 包的写入性能测试的结果。运行测试代码的硬件设备配置信息为（Intel i5-7360U, 8GB LPDDR3 RAM），写入基准测试结果如下：\n\n```bash\n$: go test -benchmem -run=^$ -bench ^BenchmarkVFSWrite$ github.com/auula/wiredb/vfs\ngoos: darwin\ngoarch: amd64\npkg: github.com/auula/wiredb/vfs\ncpu: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz\nBenchmarkVFSWrite-4   \t  173533\t      7283 ns/op\t     774 B/op\t      20 allocs/op\nPASS\nok  \tgithub.com/auula/wiredb/vfs\t2.806s\n```\n\n在项目根目录下有一个 [`tools.sh`](./tools.sh) 的工具脚本文件，可以快速帮助完成各项辅助工作。\n\n---\n\n## 🌟 Stargazers over time\n\n[![Stargazers over time](https://starchart.cc/wiredb/wiredb.svg?background=%23ffffff\u0026axis=%23333333\u0026line=%23f84206)](https://starchart.cc/wiredb/wiredb)\n\n\n---\n\n## 👬 Contributors\n\n🤝 Thanks to all the contributors below! \n\n![Contributors](https://contributors-img.web.app/image?repo=wiredb/wiredb)\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauula%2Fwiredb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauula%2Fwiredb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauula%2Fwiredb/lists"}