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.
- Host: GitHub
- URL: https://github.com/coyove/s2db
- Owner: coyove
- Created: 2021-08-27T11:31:26.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-07T09:51:00.000Z (over 1 year ago)
- Last Synced: 2025-02-05T08:51:01.309Z (8 months ago)
- Language: Go
- Homepage:
- Size: 4.02 MB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
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