# README
RedQueen
Inspired by the supercomputer (Red Queen) in "Resident Evil", the distributed key-value store is close to it in the distributed system
This is a reliable distributed key-value store based on the raft algorithm, and internal provides advanced functions such as distributed-lock...
Client call
go get github.com/RealFax/RedQueen@latest
Write & Read
RedQueen based on raft algorithm has the characteristics of single node write (Leader node) and multiple node read (Follower node).
Write-only call
Set
TrySet
Delete
Lock
Unlock
TryLock
Read-only call
Get
PrefixScan
Watch
About Internal Advanced Functions
internal advanced functions require long-term experiments to ensure its reliability
🧪 Distributed-lock (experimental functions)
RedQueen internal implements a mutex and provides grpc interface calls
⚙️ Parameters
Read order: Environment Variables | Program Arguments -> Configuration File
Environment Variables
RQ_CONFIG_FILE <string>
Configuration file path. Note: If this parameter is set, the following parameters will be ignored, and the configuration file will be used.RQ_NODE_ID <string>
Node IDRQ_DATA_DIR <string>
Node data storage directoryRQ_LISTEN_PEER_ADDR <string>
Node-to-node communication (Raft RPC) listening address, cannot be0.0.0.0
RQ_LISTEN_CLIENT_ADDR <string>
Node service listening (gRPC API) addressRQ_LISTEN_HTTP_ADDR <string>
Node service listening (http API) addressRQ_MAX_SNAPSHOTS <uint32>
Maximum number of snapshotsRQ_REQUESTS_MERGED <bool>
Whether to enable request mergingRQ_AUTO_TLS <bool>
Whether to enable auto tlsRQ_TLS_CERT_FILE <string>
TLS certificate pathRQ_TLS_KEY_FILE <string>
TLS key pathRQ_STORE_BACKEND <string [nuts]>
Storage backend (default: nuts)RQ_NUTS_NODE_NUM <int64>
RQ_NUTS_SYNC <bool>
Whether to enable synchronous disk writesRQ_NUTS_STRICT_MODE <bool>
Whether to enable call checkingRQ_NUTS_RW_MODE <string [fileio, mmap]>
Write modeRQ_CLUSTER_BOOTSTRAP <string>
Cluster information (e.g., [email protected]:5290, [email protected]:4290)RQ_DEBUG_PPROF <bool>
Enable pprof debuggingRQ_BASIC_AUTH <string>
Basic auth list (e.g., admin:123456,root:toor)
Program Arguments
-config-file <string>
Configuration file path. Note: If this parameter is set, the following parameters will be ignored, and the configuration file will be used.-node-id <string>
Node ID-data-dir <string>
Node data storage directory-listen-peer-addr <string>
Node-to-node communication (Raft RPC) listening address, cannot be0.0.0.0
-listen-client-addr <string>
Node service listening (gRPC API) address-listen-http-addr <string>
Node service listening (http API) address-max-snapshots <uint32>
Maximum number of snapshots-requests-merged <bool>
Whether to enable request merging-auto-tls <bool>
Whether to enable auto tls-tls-cert-file <string>
TLS certificate path-tls-key-file <string>
TLS key path-store-backend <string [nuts]>
Storage backend (default: nuts)-nuts-node-num <int64>
-nuts-sync <bool>
Whether to enable synchronous disk writes-nuts-strict-mode <bool>
Whether to enable call checking-nuts-rw-mode <string [fileio, mmap]>
Write mode-cluster-bootstrap <string>
Cluster information (e.g., [email protected]:5290, [email protected]:4290)-d-pprof <bool>
Enable pprof debugging-basic-auth <string>
Basic auth list (e.g., admin:123456,root:toor)
Configuration File
[node]
id = "node-1"
data-dir = "/tmp/red_queen"
listen-peer-addr = "127.0.0.1:5290"
listen-client-addr = "127.0.0.1:5230"
max-snapshots = 5
requests-merged = false
[node.tls]
auto = true
cert-file = ""
key-file = ""
[store]
# backend options
# nuts
backend = "nuts"
[store.nuts]
node-num = 1
sync = false
strict-mode = false
rw-mode = "fileio"
[cluster]
[[cluster.bootstrap]]
name = "node-1"
peer-addr = "127.0.0.1:5290"
[[cluster.bootstrap]]
name = "node-2"
peer-addr = "127.0.0.1:4290"
[misc]
pprof = false
[basic-auth]
root = "toor"
admin = "123456"
About More Usage (e.g., Docker Single/Multi-node Deployment), Please Refer to Wiki 🤩
🔍 Third-party
- nutsdb (Apache License 2.0)
- hashicorp raft (MPL License 2.0)
- boltdb (MIT License)
- BurntSushi toml (MIT License)
- google uuid (BSD-3-Clause License)
- grpc (Apache License 2.0)
- protobuf (BSD-3-Clause License)