dkvs

command module
v0.0.0-...-2cfabc9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 5 Imported by: 0

README

dkvs

An implementation of an in-memory distributed key-value storage.

Getting started

Installation
$ go get github.com/lnsp/dkvs/cmd/dkvsd
Starting up a master instance
$ dkvsd --role master --local localhost:5000 --remote ""
Starting up a secondary master
$ dkvsd --role master --local localhost:5001 --remote localhost:5000
Adding some nodes
$ dkvsd --role slave --local localhost:5002 --remote localhost:5000

High performance?

In a single node configuration it runs on a $10 DigitalOcean VPS with about 130000 req/s. Not clustered mode. Clustered mode is slow as fuck. I'm working on it.

License

Copyright 2017 Lennart Espe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

Overview

Command dkvsd starts a new cluster node.

Usage

-local string
      set the local address (default "localhost:5000")
-remote string
      set the remote address (default "localhost:5000")
-replicas int
      number of replicas in cluster (default 1)
-role string
      set node role to either master, slave or client (default "master")
-v    display version of dkvs

Configuration examples

# start a master on the local machine.
dkvsd -role master -replicas 3 -remote ""
# start a node to join the cluster
dkvsd -role slave -remote localhost:5000 -local localhost:5001

Directories

Path Synopsis
lib
Package lib provides a collection of types and methods to run a key-value storage compatible to the dkvs specification.
Package lib provides a collection of types and methods to run a key-value storage compatible to the dkvs specification.
local
Package local provides a master-slave implementation to run on a local machine.
Package local provides a master-slave implementation to run on a local machine.
local/cluster
Package cluster provides functionality for managing node cluster sets.
Package cluster provides functionality for managing node cluster sets.
local/hashtable
Package hashtable provides functionality for storing and retrieving key-value pairs associated with a specific revision.
Package hashtable provides functionality for storing and retrieving key-value pairs associated with a specific revision.
local/replicas
Package replicas provides functionality to manage master node sets.
Package replicas provides functionality to manage master node sets.
remote
Package remote provides a remote interface for network nodes.
Package remote provides a remote interface for network nodes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL