Discover Packages
github.com/imjching/hashdb
module
Version:
v0.0.0-...-7920cea
Opens a new window with list of versions in this module.
Published: May 15, 2017
License: MIT
Opens a new window with license information.
README
README
¶
keev
keev is a simple key-value store built on top of hash tables using Go. Clients communicate with the server using gRPC and Google Protocol Buffers (protobufs). Data persist to disk and saving occurs every 5 minutes.
Architecture
High-level overview:
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
Clients
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
▲
│
│ Google Protocol Buffers
│
▼
┌───────────────────────────────────────────────┐
│ gRPC │
└───────────────────────────────────────────────┘
┌───────────────────────────────────────────────┐
│ RAM or disk │
└───────────────────────────────────────────────┘
Database current accepts the following commands:
SET key value (valid if key is not present)
UPDATE key value (valid if key is present)
HAS key
UNSET key
GET key
COUNT
SHOW KEYS
SHOW DATA
SHOW NAMESPACES
USE namespace
Restrictions:
Both key
and value
cannot contain spaces.
key
cannot contain dots.
Only alphanumeric characters are allowed for namespace
Usage
Generate certificates for RPC: go run generate_cert.go --host=localhost
Change JWTSigningToken
in common/jwt.go
.
Define a list of users in data/users.json
.
Sample:
[
{
"username": "admin",
"password": "admin123",
"perms": ["ADMIN"]
},
{
"username": "user",
"password": "user123",
"perms": []
}
]
Server: ./server
Client: ./client --username="user" --password="user123"
Program
Server
Client
Future work?
Permissions for users
Tests
Logs
Own SQL-like syntax with lexer and parser
Transactions
Support for various types: numbers, etc.
Drivers for other languages
Scaling/fault-tolerant system using Raft/Paxos
Expand ▾
Collapse ▴
Directories
¶
Ref: https://github.com/rqlite/rqlite/blob/master/auth/credential_store.go Package auth is a lightweight credential store.
Ref: https://github.com/rqlite/rqlite/blob/master/auth/credential_store.go Package auth is a lightweight credential store.
Ref: https://raw.githubusercontent.com/orcaman/concurrent-map/master/concurrent_map.go Have to put it here since we need UnmarshalJSON
Ref: https://raw.githubusercontent.com/orcaman/concurrent-map/master/concurrent_map.go Have to put it here since we need UnmarshalJSON
Package protobuf is a generated protocol buffer package.
Package protobuf is a generated protocol buffer package.
Click to show internal directories.
Click to hide internal directories.