Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imjching/keev
A simple key-value store based on gRPC and protobufs
https://github.com/imjching/keev
database go grpc key-value protobuf
Last synced: 21 days ago
JSON representation
A simple key-value store based on gRPC and protobufs
- Host: GitHub
- URL: https://github.com/imjching/keev
- Owner: imjching
- License: mit
- Created: 2017-05-05T18:07:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T19:03:44.000Z (over 7 years ago)
- Last Synced: 2024-11-02T06:59:26.505Z (about 2 months ago)
- Topics: database, go, grpc, key-value, protobuf
- Language: Go
- Homepage:
- Size: 229 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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 namespaceRestrictions:
* Both `key` and `value` cannot contain spaces.
* `key` cannot contain dots.
* Only alphanumeric characters are allowed for `namespace`## Usage
1. Generate certificates for RPC: `go run generate_cert.go --host=localhost`
2. Change `JWTSigningToken` in `common/jwt.go`.
3. Define a list of users in `data/users.json`.
Sample:
```json
[
{
"username": "admin",
"password": "admin123",
"perms": ["ADMIN"]
},
{
"username": "user",
"password": "user123",
"perms": []
}
]
```Server: `./server`
Client: `./client --username="user" --password="user123"`## Program
### Server
![server.png](server.png)### Client
![client.png](client.png)## 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