Production-ready TCP server with security, clustering, and monitoring.
Admin -- Full access to all commands including user managementReadWrite -- CRUD, indexes, transactions, blobs, search, proceduresRead -- Queries, counts, aggregations, list operations onlyOxiWire is OxiDB's custom binary protocol. Fixed-size encoding (1-byte type tags, 4-byte LE lengths, 8-byte LE numbers). Faster than JSON and MsgPack for both serialization and deserialization.
Clients can also use plain JSON over the same TCP connection.
Multi-node replication via Raft consensus (openraft). Each node runs its own state machine and persistent log; writes commit on quorum (2/3 for a 3-node group). Enable with the cluster feature flag in oxidb-server.
Persistent state v0.34.0 — Raft state is written to raft_meta.json + raft_log.jsonl on every mutation. Nodes survive container restarts and rejoin their Raft group automatically (previously the node would come back as a fresh Learner and the cluster would diverge).
To bootstrap a 3-node cluster, send raft_init on node 1, then raft_add_learner for nodes 2 and 3, then raft_change_membership: [1, 2, 3]. The full reference deployment lives at ShardReplicaRealWorldTest/ — 3 shards × 3 Raft nodes, fronted by oxipool, validated under 1M-record load with mid-stream failover.
| Environment Variable | Default | Description |
|---|---|---|
OXIDB_ADDR | 127.0.0.1:4444 | Client bind address |
OXIDB_DATA | ./oxidb_data | Data directory (also holds raft_meta.json + raft_log.jsonl) |
OXIDB_POOL_SIZE | 4 | Worker thread count |
OXIDB_IDLE_TIMEOUT | 30 | Connection timeout (seconds, 0 = never) |
OXIDB_DISK_FIRST | 1 (on) | Document bodies in an mmap'd file; only a ~24 B/doc offset index stays resident, so RSS does not scale with the dataset. 0 = always-resident mode (fastest point reads). Existing collections keep their format. |
OXIDB_WAL_CHECKPOINT_BYTES | 67108864 | Checkpoint the document WAL online past this size (64 MiB; 0 = only at shutdown) |
| Protocol listeners (off unless set) | ||
OXIDB_MQTT_PORT | — | MQTT 3.1.1 broker (+ OXIDB_MQTT_USER/_PASSWORD, OXIDB_MQTT_PERSIST) |
OXIDB_AMQP_PORT | — | AMQP 0-9-1 (RabbitMQ protocol) (+ OXIDB_AMQP_USER/_PASSWORD); durable queues persist via the document engine |
| Cluster mode (--features cluster) | ||
OXIDB_NODE_ID | — | Required to enable cluster mode. Unique u64 per node within a Raft group. |
OXIDB_RAFT_ADDR | 127.0.0.1:4445 | Bind address for Raft RPC (separate from client port) |
OXIDB_RAFT_PEERS | — | 1=node1:5000,2=node2:5000,3=node3:5000 |