A reactive, key-value database with ACID guarantees, designed for scenarios where low-latency reads, real-time change notification, and minimal resource consumption matter.
Core database
- Key-value. Text keys, arbitrary binary values.
- Client-server. Clients connect over TCP using a compact binary protocol.
- Persistence. Append-only journal with periodic snapshots.
- ACID. Atomic, consistent, isolated, and durable transactions.
- Snapshots. Retrieve a consistent database state at any revision.
- Streaming. Stream updates since a given revision.
- ACL security. CRUD permissions over key patterns.
What makes it different
- Blazing-fast. Data lives in client memory. Reads never hit the server.
- Reactive. Clients receive real-time change notifications.
- High throughput. Sub-millisecond commits and high transaction throughput.
- Low resource footprint. Minimal CPU, memory, and disk usage.
Transaction features
- Serializable transactions using optimistic concurrency control (OCC).
- Isolation levels (read committed, repeatable read, and serializable).
- Preconditions (assert selected keys have not changed since the transaction revision).
- Force mode (bypass serialization checks; restricted by ACL permissions).
- The client connects and authenticates.
- The client requests a snapshot at a specific revision.
- The server sends a snapshot filtered according to the client's permissions.
- The client requests a stream of updates since a given revision.
- The server sends all existing updates filtered according to the client's permissions.
- The server pushes subsequent updates in real time, filtered according to the client's permissions.
- The client queries its own in-memory copy, never the server.
- The client submits a transaction to the server.
- The server validates it, persists it, and broadcasts the update to all connected clients.
Each accepted transaction increments the database revision. Every key-value pair is tagged with the revision that last modified it. Transactions are atomic and serializable. Transactions are validated by the server at commit time; those that would violate serializability are rejected and must be retried.
Transactions are managed on the client side. Each client maintains a local copy of the database state and supports READ_COMMITTED, REPEATABLE_READ, and SERIALIZABLE isolation levels. Transactions that can no longer preserve their isolation guarantees are automatically invalidated.
The only way to interact with Nplex is through a client library. There is no built-in CLI or GUI - you write the client that fits your use case.
Currently available:
| Library | Language | Notes |
|---|---|---|
| nplex-cpp | C++ | High performance — a single client can sustain >40,000 commits/s on a modest machine (NUC7i7BNH). |
An administration console (
nplexctl) is planned but not yet available.
| Area | Constraint |
|---|---|
| Clients | Tens of concurrent clients (~50) |
| Data size | Must fit in memory (~300 MB) |
| Configuration | Clients are pre-declared in config file |
| Encryption | TLS not yet implemented |
| Admin console | Not yet available |
| Metrics | No Prometheus/SNMP export yet |
| Replication | No Raft-based replication yet |
| Compression | No compression for snapshots or updates |
Consider a car chassis assembly line — a set of robots and mechanisms controlled by PLCs. Most data points (sensors, actuators, setpoints) are known in advance.
Several modules share configuration and live data through Nplex:
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ I/O │ │ Stats │ │ Control │ │ Display │
│ module │ │ module │ │ module │ │ module │
└────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘
└──────────────┴──────┬───────┴──────────────┘
┌───┴───┐
│ nplex │
└───────┘
- I/O — Reads from physical devices (Modbus, PLCs) and writes values to Nplex. Reacts to variable changes notified by Nplex by sending commands to actuators.
- Stats — Computes KPIs, counters, and statistics in real time as data arrives, storing results back into Nplex.
- Control — Business rules that operate on system state: alarms, actuation orders. Can be organized into sub-modules (energy, general, safety…).
- Display — A web application (e.g. Java) serving dashboards over HTTPS + WebSockets. Shows a command panel (alarms, KPIs), SVG-based system diagrams, and live data updates powered by Nplex reactivity + WebSockets.
- nplex — It manages system configuration and state preservation while ensuring durable data persistence and integrity. Controlled redistribution of data across components.
- Initial development complete.
- Architecture designed for performance.
- Compact codebase — under 5,000 lines of application code.
- Modern, pragmatic C++20 — clarity and simplicity over cleverness.
- Code quality checked with static analysis, Valgrind, and sanitizers.
- Not yet profiled — there is room for performance optimization.
- Missing lateral features to become a full product (TLS, admin console, metrics…).
- Active development is not planned unless there is community interest.
- No active installations at this time.
Bottom line: Nplex can be a good fit if you need tight control over this piece of your architecture and are willing to invest time in it. Otherwise, consider proven alternatives that cover parts of what Nplex offers — etcd, FoundationDB, or TiKV.
- Getting Started — Building, running, and architecture details.
- Configuration Reference — All configuration parameters with defaults and descriptions.
- Project History — The story behind Nplex: motivations and lessons learned.
This project is maintained by Gerard Torrent (torrentg).
This project is licensed under the MIT License — see the LICENSE file for details.
For dependency licenses, see the Dependencies section.