An open API service indexing awesome lists of open source software.

https://github.com/coyove/s2db

s2db is a sorted set database who speaks redis protocol and stores data on disk.
https://github.com/coyove/s2db

Last synced: 6 months ago
JSON representation

s2db is a sorted set database who speaks redis protocol and stores data on disk.

Awesome Lists containing this project

README

          

# s2db
s2db is a sorted set database who speaks redis protocol and stores data on disk.

# Startup Sequence
1. Start slave server by `s2db -l : -C0 servername=`, listening at `SlaveIp:SlavePort`.
2. Start master server by `s2db -l : -C0 slave=:/?Name=`, listening at `Ip:Port`.

# Configuration Fields
- `ServerName (string)`: server's name
- `Password (string)`: server's password
- `Slave (string)`: slave's conn string, minimal form: `:/?Name=`:
- `PullMaster (string)`: master's conn string, minimal form: `:/?Name=`:
- `MarkMaster (int, 0|1)`: mark server as master, rejecting all PUSHLOGS requests
- `Passthrough (string)`: relay all read-write commands to the destinated endpoint, minimal form: `:/?Name=`:
- `PingTimeout (int, milliseconds)`: ping timeout of slave, used by master
- `CacheSize (int)`: cache size (number of cached objects)
- `CacheObjMaxSize (int, kilobytes)`: max allowed size of a cached object, -1 means no object can be cached
- `SlowLimit (int, milliseconds)`: threshold of recording slow commands into ./log/slow.log
- `ResponseLogSize (int, bytes)`: max size of logs master can push to slave in PUSHLOGS
- `BatchMaxRun (int)`: batch operations size
- `BatchFirstRunSleep (int, milliseconds)`: time window of grouping continuous deferred commands
- `CompactLogsTTL (int, seconds)`: TTL of logs
- `MetricsEndpoint (string)`: address of metrics collector, null means recording to internal metrics only

# Commands
Refer to COMMANDS.txt.

# Web Console
Web console can be accessed at the same address as flag `-l` identified, e.g.: `http://127.0.0.1:6379` and `http://127.0.0.1:6379/debug/pprof/`.

# Built-in Scripts
s2db use a Lua dialect called `nj` as its script engine, to learn more, refer to this [repo](https://github.com/coyove/nj).

# Redirected 3rd-party Lib
1. https://github.com/secmask/go-redisproto