All Projects → pdb64 → pbdb

pdb64 / pbdb

Licence: BSD-3-Clause License
A key/value database inspired by chapter 3 of Designing Data-Intensive Applications by Martin Kleppmann.

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to pbdb

rocks4j
KV Store for Java backed by RocksDB
Stars: ✭ 13 (-48%)
Mutual labels:  kv-database, kv-store
orbit-db-kvstore
Key-Value database for orbit-db
Stars: ✭ 24 (-4%)
Mutual labels:  kv-store
rosedb
🚀 A high performance NoSQL database based on bitcask, supports string, list, hash, set, and sorted set.
Stars: ✭ 2,957 (+11728%)
Mutual labels:  kv-store
mirdb
MirDB: A Persistent Key-Value Store with Memcached protocol.
Stars: ✭ 75 (+200%)
Mutual labels:  kv-database
opsbro
Ops Best friend
Stars: ✭ 37 (+48%)
Mutual labels:  kv-store
Nutsdb
A simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set.
Stars: ✭ 1,827 (+7208%)
Mutual labels:  kv-store

pbdb

Go Reference

Description

pbdb is a key/value database inspired by chapter 3 of Designing Data-Intensive Applications by Martin Kleppmann.

The underlying storage format is very simple: a text file where each line contains a key-value pair, separated by a comma (roughly like a CSV file, ignoring escaping issues). Every call to db_set appends to the end of the file, so if you update a key several times, the old versions of the value are not overwritten — you need to look at the last occurrence of a key in a file to find the latest value [...] (Kleppmann 2017)

It also uses a hash index (like Kleppmann later suggests) to speed up reads.

Installation

Option A: Build and run the provided Dockerfile

docker build -t pbdb:latest .
docker run -p 1728:1728/tcp pbdb:latest

Option B: Compile and run the source code

go build
./pbdb run -d dbfile

Usage

pbdb is an experiment and not meant for production by any sense of the word. However, if you wish to run it here's how:

pbdb run --data DATABASE_FILE --port PORT

This will start the database and bind it to PORT (default: 1728). The database will survive restarts, but will need a moment to reindex its in-memory hash index. You can interact with the database using http.

$ curl localhost:1728/set/foo -d bar
$ curl localhost:1728/get/foo
bar$

Caveats

  • You'll have a bad time if your values have new line characters.
  • There's no authentication. You have been warned.

Works Cited

Kleppmann, Martin. Designing Data-Intensive Applications (Kindle Locations 1934-1937). O'Reilly Media. Kindle Edition.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].