https://github.com/yowcow/goromdb
Yet another single process KVS server implemented over file-based database
https://github.com/yowcow/goromdb
berkeley-db boltdb golang
Last synced: 5 months ago
JSON representation
Yet another single process KVS server implemented over file-based database
- Host: GitHub
- URL: https://github.com/yowcow/goromdb
- Owner: yowcow
- License: unlicense
- Created: 2017-10-02T12:30:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-01-10T08:25:34.000Z (over 6 years ago)
- Last Synced: 2025-01-28T11:08:51.737Z (over 1 year ago)
- Topics: berkeley-db, boltdb, golang
- Language: Go
- Homepage:
- Size: 263 KB
- Stars: 12
- Watchers: 4
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/yowcow/goromdb)
[](https://goreportcard.com/report/github.com/yowcow/goromdb)
GOROMDB
=======
Yet another single process KVS server implemented over file-based database.
GOROMDB is a datastore that:
+ accepts read-only access
+ talks multiple protocols like memcached and others
+ handles multiple database backends like JSON, BerkeleyDB, BoltDB, and others
STRUCTURE
---------
```
.---------.
| watcher |
'----+----'
|
.--------. .----+----. .---------.
TCP --> | server +---+ handler +---+ storage |-.
'----+---' '----+----' '---------' | <-- Replacable database
| | '---------'
.-----+----. .---+----.
| protocol | | loader |
'----------' '--------'
```
HOW TO USE
----------
GOROMDB can be used as an executable binary, or a collection of simple libraries.
### Executable Binary
Just do:
```
go install github.com/yowcow/goromdb
```
An example of booting GOROMDB with BerkeleyDB database is:
```
goromdb -addr :11211 -storage bdb -file path/to/bdb-data.db -basedir path/to/store
```
Note that default compilation of the binary only covers basic features of GOROMDB.
If full capability, like namespaced database, and/or multiple database file deployment, is required, craft libraries and build GOROMDB for your own.
GOROMDB does not daemonize itself. Look of other tools to daemonize GOROMDB.
### Libraries
Just do:
```
go get github.com/yowcow/goromdb
```
and import whatever package into your source code.
BENCHMARK AND PERFORMANCE
-------------------------
GOROMDB should serve fast but maybe not quite as fast as pure memcached.
Detailed benchmark is comming up.
DIRECTORY STRUCTURE
-------------------
When `-basedir` of `/tmp/path/to/dir` is specified at boot, GOROMDB creates subdirectories `data00` and `data01` under `/tmp/path/to/dir`:
```
/tmp/path/to/dir
├── db00
└── db01
```
When `-file` of `/tmp/path/to/dir/data.db` is specified at boot, GOROMDB will watch for database file `/tmp/path/to/dir/data.db` and its MD5 sum file `/tmp/path/to/dir/data.db.md5`.
When database and MD5 files are placed in directory `/tmp/path/to/dir`, GOROMDB will verify MD5 sum.
```
/tmp/path/to/dir
├── data00
├── data01
├── data.db
└── data.db.md5
```
Once MD5 sum verification succeeds, GOROMDB will move data file into subdirectory either `data00` or `data01`, and load the database into running server.
```
/tmp/path/to/dir
├── data00
│ └── data.db
└── data01
```
Placing database and MD5 sum files again will load database into next subdirectory `data01` vice versa.