https://github.com/chientrm/kadb
Lightning fast Immutable Key-Array Database server.
https://github.com/chientrm/kadb
chatbox database forum logging mailbox
Last synced: 4 months ago
JSON representation
Lightning fast Immutable Key-Array Database server.
- Host: GitHub
- URL: https://github.com/chientrm/kadb
- Owner: chientrm
- Created: 2022-08-07T16:21:45.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-13T03:53:40.000Z (over 3 years ago)
- Last Synced: 2025-10-12T21:32:02.526Z (8 months ago)
- Topics: chatbox, database, forum, logging, mailbox
- Language: C
- Homepage:
- Size: 875 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kadb
Lightning fast Immutable Key-Array Database.
# Common use cases
- Logging server
- Uneditable chat room/forum
- Uneditable mailbox
# Why `kadb`?
- Write value: O(logn)
- Read subarray: O(logn)
_n is the total number of key_
## Implementation
- Linux's io_uring
- AVL Tree
- Array accumulated items length
- realloc strategy `double`
- Single-threaded
## Clone
```bash
git clone https://github.com/chientrm/kadb
```
## Build
```bash
cd kadb
./configure
make kadb
```
## Start server
```bash
kadb
```
`Listening on http://localhost:8080`
## GET
Get `10` value of key `key-1` (5 bytes length) from offset `0`
```bash
curl http://localhost:8080/0005/0000/0010/key-1
```
Example result
```
HTTP Header
------------------------
Kadb-n_items: 2
Content-Type: text/plain
Content-Length: 13
HTTP Body
------------------------
value1;value2;
```
meaning key `key-1` has total 2 items.
## PUT
Put value `1234` to key `abc`.
```bash
curl http://localhost:8080/0003/0004/abc1234
```
Result status code `200`
## Benchmarks
...coming soon...