db/

directory
v0.0.0-...-bc5e729 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: MPL-2.0

README

db

db contains master and node using raft consensus algorithm.

Master

We only need one master to mantain the system status, so the master only for:

  1. Wraps the meta data query: register/get/update raft peers.
  2. Send heartbeats to every known node, remove any of them wich down or network partition.

Node

  1. Every node combines a HTTP server and a Raft instance.
  2. HTTP server handles serveral API:
  3. GET /i/key/:key for get the value of the :key.
  4. POST /key for add a pair of key and value.
  5. POST /join for join a peer into the cluster, reject if current raft instance is not a Leader.
  6. GET /ping for master heartbeat.
  7. GET /stats for stats of current raft instance.

Directories

Path Synopsis
node
service
Package service provides the HTTP server for accessing the distributed key-value store.
Package service provides the HTTP server for accessing the distributed key-value store.
store
Package store provides a simple distributed key-value store.
Package store provides a simple distributed key-value store.

Jump to

Keyboard shortcuts

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