yakv is a simple, in-memory, concurrency-safe key-value store for hobbyists.

Overview

yakv (yak-v. (originally intended to be "yet-another-key-value store")) is a simple, in-memory, concurrency-safe key-value store for hobbyists.

yakv provides persistence by appending transactions to a transaction log and restoring data from the transaction log on startup.

yakv is designed with simplicity as the main purpose and has almost zero external dependencies.

Table of Contents:

Installation

Install using:

  • One-Script Installation (Linux):

    curl https://raw.githubusercontent.com/burntcarrot/yakv/main/install.sh | bash
    
  • Docker:

    git clone https://github.com/burntcarrot/yakv
    cd yakv
    docker build --tag yakv .
    docker run -p 8080:8080 yakv /bin/sh -c "/yakv -host 0.0.0.0"
    
  • Install from source:

    You can run directly from the source files:

    git clone https://github.com/burntcarrot/yakv
    cd yakv
    go run main.go -port 8080
    

    Or, you can build the binary on your own:

    git clone https://github.com/burntcarrot/yakv
    cd yakv
    go build
    

Methods

yakv exposes a HTTP/HTTPS API and provides 3 methods to deal with data:

  • GET:
    • On a HTTPS server without certificate:
    curl -X GET --header "Content-Type: application/json" -d '{"key": "yakv"}' https://0.0.0.0:8080/yakv/v0/get --insecure
    
    • On a HTTP server:
    curl -X GET --header "Content-Type: application/json" -d '{"key": "yakv"}' http://0.0.0.0:8080/yakv/v0/get
    
  • PUT:
    • On a HTTPS server without certificate:
    curl -X PUT --header "Content-Type: application/json" -d '{"key": "yakv", "value": "Hello, yakv!"}' https://0.0.0.0:8080/yakv/v0/put --insecure
    
    • On a HTTP server:
    curl -X PUT --header "Content-Type: application/json" -d '{"key": "yakv", "value": "Hello, yakv!"}' http://0.0.0.0:8080/yakv/v0/put
    
  • DELETE:
    • On a HTTPS server without certificate:
    curl -X DELETE --header "Content-Type: application/json" -d '{"key": "yakv"}' https://0.0.0.0:8080/yakv/v0/delete --insecure
    
    • On a HTTP server:
    curl -X DELETE --header "Content-Type: application/json" -d '{"key": "yakv"}' http://0.0.0.0:8080/yakv/v0/delete
    

yakv currently accepts request bodies in the form of JSON.

Options

Here are the list of options or the command line flags provided by yakv:

yakv [OPTIONS]

OPTIONS:
    - port
        Port number for starting yakv.
    - host
        Host address for starting yakv.

    -secure
        Enable TLS-encrypted connection.
    - cert
        Filename for certificate.
    - key
        Filename for private key.

    -filename
        Filename for transaction log.

Transaction Log

All of the transactions are backed up in a transaction log, which are automatically loaded up by yakv on start-up.

Security

yakv provides a TLS-encrypted HTTPS connection using the -secure flag.

A certificate and a matching private key for the server must be provided through the -cert and -key flags respectively.

If the flags are not provided, yakv assumes the certificate and key to be named as cert.pem and key.pem in the current directory.

Example:

On Docker:

docker run -p 8080:8080 yakv /bin/sh -c "/yakv -host 0.0.0.0 -secure tls"

Locally:

  • From source code:
    go run main.go -port 8080 -secure tls
    
  • From binary:
    ./yakv -port 8080 -secure tls
    

Benchmarks

Benchmarks are done using vegeta.

All of the benchmarks are performed under these device specifications:

Processor:
Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz   1.80 GHz

Installed RAM:
8.00 GB (7.85 GB usable)

System type:
64-bit operating system, x64-based processor

NOTE: rate is set manually. This does not denote the maximum number of requests yakv can handle.

5,000 PUT requests in 100 seconds *(rate = 50 requests/second)*:

Available RAM while performing benchmark: 3.8 GB

Requests      [total, rate, throughput]         5000, 50.01, 50.01
Duration      [total, attack, wait]             1m40s, 1m40s, 1.13ms
Latencies     [min, mean, 50, 90, 95, 99, max]  467.4µs, 2.687ms, 2.949ms, 3.579ms, 3.652ms, 3.723ms, 14.932ms
Bytes In      [total, mean]                     0, 0.00
Bytes Out     [total, mean]                     185000, 37.00
Success       [ratio]                           100.00%
Status Codes  [code:count]                      201:5000
Error Set:

PUT-Benchmark

Contributing Guide

Read the contributing guide here.

Attributions

The yak vector is provided by OpenClipart/FreeSVG under the Public Domain.

Issues
Releases(v0.1.1)
Owner
Aadhav Vignesh
[ping me if you're hiring! 💼]
Aadhav Vignesh
Distributed cache and in-memory key/value data store. It can be used both as an embedded Go library and as a language-independent service.

Olric Distributed cache and in-memory key/value data store. It can be used both as an embedded Go library and as a language-independent service. With

Burak Sezer 1.8k Jul 23, 2021
Simple, ordered, key-value persistence library for the Go Language

gkvlite gkvlite is a simple, ordered, ACID, key-value persistence library for Go. Overview gkvlite is a library that provides a simple key-value persi

Steve Yen 242 Jan 19, 2021
An embedded key/value database for Go.

Bolt Bolt is a pure Go key/value store inspired by Howard Chu's LMDB project. The goal of the project is to provide a simple, fast, and reliable datab

BoltDB 12k Jul 24, 2021
Key-value database stored in memory with option of persistence

Easy and intuitive command line tool allows you to spin up a database avaliable from web or locally in a few seconds. Server can be run over a custom TCP protocol or over HTTP.

Mario Petričko 7 Jul 11, 2021
Distributed, fault-tolerant key-value storage written in go.

A simple, distributed, fault-tolerant key-value storage inspired by Redis. It uses Raft protocotol as consensus algorithm. It supports the following data structures: String, Bitmap, Map, List.

Igor German 353 Jun 9, 2021
A disk-backed key-value store.

What is diskv? Diskv (disk-vee) is a simple, persistent key-value store written in the Go language. It starts with an incredibly simple API for storin

Peter Bourgon 1.1k Jul 19, 2021
Fault tolerant, sharded key value storage written in GoLang

Ravel is a sharded, fault-tolerant key-value store built using BadgerDB and hashicorp/raft. You can shard your data across multiple clusters with mult

Aditya Meharia 68 Jul 6, 2021
A key-value db api with multiple storage engines and key generation

Jet is a deadly-simple key-value api. The main goals of this project are : Making a simple KV tool for our other projects. Learn tests writing and git

null 12 May 9, 2021
High-performance, columnar, in-memory store with bitmap indexing in Go

This package contains a high-performance, columnar, in-memory storage engine that supports fast querying, update and iteration with zero-allocations and bitmap indexing.

Roman Atachiants 749 Jul 12, 2021
decentralized kv store based on pubsub in libp2p

pointers decentralized kv store based on pubsub in libp2p Protocol Specification Over View The pointer would receive updates from pubsub network and b

Rorical 4 Jul 11, 2021
a persistent real-time key-value store, with the same redis protocol with powerful features

a fast NoSQL DB, that uses the same RESP protocol and capable to store terabytes of data, also it integrates with your mobile/web apps to add real-time features, soon you can use it as a document store cause it should become a multi-model db. Redix is used in production, you can use it in your apps with no worries.

Mohammed Al Ashaal 945 Jul 9, 2021
Pogreb is an embedded key-value store for read-heavy workloads written in Go.

Embedded key-value store for read-heavy workloads written in Go

Artem Krylysov 799 Jul 14, 2021
moss - a simple, fast, ordered, persistable, key-val storage library for golang

moss provides a simple, fast, persistable, ordered key-val collection implementation as a 100% golang library.

null 819 Jul 21, 2021
LevelDB key/value database in Go.

This is an implementation of the LevelDB key/value database in the Go programming language. Installation go get github.com/syndtr/goleveldb/leveldb R

Suryandaru Triandana 4.5k Jul 25, 2021