Skip to content

Quickstart

This page starts a server, connects with redis-cli, runs a few commands across different data types, and enables persistence. It assumes you already have a frogdb-server binary or Docker image — see Installation if you don’t yet. FrogDB speaks RESP2 and RESP3, and targets compatibility with Redis 8.6.0 commands — see Compatibility for exactly which commands and behaviors differ.

Terminal window
# Start with defaults: 127.0.0.1:6379, persistence enabled, 1 shard
frogdb-server
# Or with a config file
frogdb-server --config frogdb.toml
# Bind to all interfaces, one shard per CPU core
frogdb-server -b 0.0.0.0 -s auto

By default the bare binary listens on 127.0.0.1:6379 with a single shard. -s auto sizes the shard count to the number of CPU cores instead.

Terminal window
redis-cli -p 6379

A string:

127.0.0.1:6379> SET greeting "Hello from FrogDB!"
OK
127.0.0.1:6379> GET greeting
"Hello from FrogDB!"
127.0.0.1:6379> INCR counter
(integer) 1
127.0.0.1:6379> EXPIRE greeting 60
(integer) 1
127.0.0.1:6379> TTL greeting
(integer) 60

A hash:

127.0.0.1:6379> HSET user:1 name "Ada" role "admin"
(integer) 2
127.0.0.1:6379> HGETALL user:1
1) "name"
2) "Ada"
3) "role"
4) "admin"

A sorted set:

127.0.0.1:6379> ZADD leaderboard 100 alice 85 bob
(integer) 2
127.0.0.1:6379> ZRANGE leaderboard 0 -1 WITHSCORES
1) "bob"
2) "85"
3) "alice"
4) "100"

A list:

127.0.0.1:6379> LPUSH queue job1 job2
(integer) 2
127.0.0.1:6379> LRANGE queue 0 -1
1) "job2"
2) "job1"

This is a small slice of what’s supported — see the command matrix for the full, generated list of every command and its support status, and Compatibility for behavioral differences from Redis.

Persistence is enabled by default, backed by RocksDB. The bare binary writes to ./frogdb-data (relative to the working directory it’s started from); the Debian package’s default config points this at /var/lib/frogdb/data instead.

[persistence]
enabled = true
data-dir = "./frogdb-data"
durability-mode = "periodic" # async, periodic, or sync
sync-interval-ms = 1000

durability-mode controls when writes are flushed to disk: async batches writes with no fixed interval, periodic (the default) flushes every sync-interval-ms, and sync flushes every write before acknowledging it — each mode trades some durability for throughput. See Operations → Persistence for details on snapshots, recovery, and choosing a durability mode.

FrogDB reads configuration from a TOML file, FROGDB_<SECTION>__<FIELD> environment variables, and CLI flags, in increasing order of precedence (CLI flags win); most settings can also be changed at runtime with CONFIG SET. See Operations → Configuration for how those surfaces combine.

Generate a default config file to see every setting and its default value:

Terminal window
frogdb-server --generate-config > frogdb.toml

An excerpt:

[server]
bind = "127.0.0.1"
port = 6379
num-shards = 1
[persistence]
enabled = true
data-dir = "./frogdb-data"
durability-mode = "periodic"
sync-interval-ms = 1000
[memory]
maxmemory = 0 # 0 = unlimited
maxmemory-policy = "noeviction"

See Configuration Reference for every field, or Example Config File for a complete generated file.

Any RESP2/RESP3-capable Redis client library works with FrogDB over the standard redis:// protocol; this guide uses redis-cli for simplicity. See redis.io’s client list for clients in your language.