Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ksukhorukov/Vitamin
Blazingly fast key-value storage
https://github.com/ksukhorukov/Vitamin
Last synced: 11 days ago
JSON representation
Blazingly fast key-value storage
- Host: GitHub
- URL: https://github.com/ksukhorukov/Vitamin
- Owner: ksukhorukov
- Created: 2019-12-09T19:39:11.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-03T18:19:02.000Z (over 4 years ago)
- Last Synced: 2024-06-19T15:11:08.438Z (5 months ago)
- Language: Go
- Homepage:
- Size: 11.7 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-blazingly-fast - Vitamin - Blazingly fast key-value storage (Go)
README
# Vitamin
Blazingly fast key-value storage
## Features
- Simple interface
- Fault tolerance
- Master-master replication## Dependencies
- Golang 1.10.4
- RabbitMQ 3.6.10## Build & Run
```bash
go get github.com/streadway/amqp
go build ./vitamin.go
./vitamin
```
## UseStore "test_key" for 60 seconds
```bash
nc localhost 8080
set("test_key","test value",60)
test value
```
Get "test_key"```bash
get("test_key")
test value
```## Master-Master replication and fault-tollerant quorum
It is easy to distribute work between several instances of Vitamin located at different servers with help of out of the box Master-Master replication.
Let's suppose we have four severs: vitamin_first_node (192.168.10.10), vitamin_second_node (192.168.10.11), server with RabbitMQ (192.168.10.12) and load balancer server (192.168.10.13).
For the sace of simplicity we will use HAProxy for load balancing. Example configuration can be found [here](https://github.com/ksukhorukov/Vitamin/blob/master/haproxy/haproxy.cfg)
![](https://github.com/ksukhorukov/Vitamin/raw/master/images/network.png)
Run RabbitMQ(192.168.10.12):
```bash
/etc/init.d/rabbitmq-server start
```Run first server (192.168.10.10):
```bash
./vitamin --rabbitmq_host=192.168.0.12 --rabbitmq_port=5672 --rabbitmq_user=guest --rabbitmq_password=guest --rabbitmq_exchange=vitamin
```Run second server (192.168.10.11):
```bash
./vitamin --rabbitmq_host=192.168.0.12 --rabbitmq_port=5672 --rabbitmq_user=guest --rabbitmq_password=guest --rabbitmq_exchange=vitamin
```Run Nth server (192.168.10.N):
```bash
./vitamin --rabbitmq_host=192.168.0.N --rabbitmq_port=5672 --rabbitmq_user=guest --rabbitmq_password=guest --rabbitmq_exchange=vitamin
```Do not forget to replace 192.168.10.N to real ip of your Nth server.
Run load-balancer (192.168.10.13):
```bash
/etc/init.d/haproxy start
```For now all request to load-balancer (192.168.10.13:8080) will be evenly distributed across cache servers.
You don't need to think about replication it comes with Vitamin out of the box.## Help
```bash
./vitamin --help
```## [EOF]