Features
The features of Raft DB, grouped by area, each with its state (built, partly built, not built) taken from the project's records and tests.
This page lists what exists. A feature is marked built only when the code and a test show it; partly says what is missing; not built features are listed so that nobody searches for them. The longer list of gaps is What is not there yet.
Storage#
| Feature | State | Notes |
|---|---|---|
| JSON-native documents | built | A row is a binary document (raftdb-doc): typed tags, a field-name dictionary, about 0.44 of the JSON size. A document read back is the document written. |
| In-memory engine (default) | built | The whole table is in RAM; restart replays the log of each shard. |
Disk-resident engine (engine = lsm) | built, opt-in | A log-structured merge tree (raftdb-lsm): data may be larger than memory, restart replays at most one memtable. New tables only; existing tables keep their engine. |
| Write-ahead log, group commit | built | An acknowledged write is on disk. Many writers share one fsync. Windows: the log is opened write-through (D37). |
| Checkpoints | built | The log is rewritten as the shortest equivalent log at start when it is large and mostly dead, or on demand over HTTP. Not while serving writes. |
| Strict schema (native API) | built | A table of the native API can carry a schema: required, nullable, ranges. No silent type coercion anywhere (D5). |
| Secondary indexes | built | Hash and ordered indexes on top-level fields, maintained on writes, stored in the log; the planner uses them when a required comparison can. Persisted index runs are not built: indexes are rebuilt at open. |
Row versions (raftdb-mvcc) | building block only | A 12-byte version header and snapshot visibility, measured at 495 M checks/s. It is not connected to SQL transactions: see Transactions below. |
Queries#
| Feature | State | Notes |
|---|---|---|
| One plan for JSON filters and SQL | built | Both compile to the same plan (raftdb-exec, D31); same scan, same index choice, same paging. |
| SQL front-end for MySQL 8 and MariaDB 11 | built, large subset | Joins, grouping, subqueries, set operations (UNION, INTERSECT, EXCEPT), common table expressions including recursive ones, window functions, GROUP BY ... WITH ROLLUP, VALUES, TABLE. |
| Data types | built | Integer family (signed and unsigned), FLOAT, DOUBLE, DECIMAL up to 65 digits, CHAR, VARCHAR, TEXT family, BLOB and BINARY, ENUM, SET, BIT, DATE, DATETIME, TIMESTAMP, TIME, YEAR (with fractional seconds), JSON, BOOLEAN; MariaDB UUID, INET4, INET6. |
| JSON functions and operators | built | JSON_EXTRACT, JSON_SET, JSON_OBJECT, JSON_CONTAINS, JSON_SEARCH, ->, ->>, MEMBER OF, and about forty more; MySQL's JSON error wording. |
| Functions | built | A large library of string, numeric, date, regular-expression (REGEXP, REGEXP_REPLACE, ...) and aggregate functions (GROUP_CONCAT, BIT_AND, ...). |
| Prepared statements | built | The binary protocol (COM_STMT_*) and, for MariaDB, SQL-level PREPARE / EXECUTE. Server-side cursors (COM_STMT_FETCH) are not built. |
| Views | built | CREATE [OR REPLACE] VIEW, ALTER VIEW, DROP VIEW; simple views are updatable. WITH CHECK OPTION is stored, not enforced. |
| Stored procedures and functions | built | CREATE PROCEDURE / FUNCTION with variables, IF, CASE, loops, cursors, handlers, SIGNAL, several result sets per call. Stored events are not built. |
| Triggers | built | BEFORE / AFTER INSERT / UPDATE / DELETE, FOR EACH ROW, with NEW and OLD. |
| Sequences (MariaDB dialect) | built | CREATE SEQUENCE, NEXTVAL, LASTVAL, SETVAL, NEXT VALUE FOR. |
| Generated columns, check constraints, invisible columns, functional indexes | built | Stored and virtual generated columns; CHECK; INVISIBLE columns and indexes; indexes on expressions. |
| Foreign keys | built | With CASCADE, SET NULL, RESTRICT, enforced by the front-end. |
Temporary tables, CREATE TABLE ... LIKE, CREATE TABLE ... AS SELECT | built | |
information_schema | built, partial | The common tables (SCHEMATA, TABLES, COLUMNS, STATISTICS, KEY_COLUMN_USAGE, ...). The mysql, performance_schema and sys schemas are not real databases. |
Transactions#
START TRANSACTION, COMMIT, ROLLBACK, SAVEPOINT and autocommit behave as in MySQL, and a failing statement is all-or-nothing. Sessions are isolated one table at a time (a writer holds its tables until the end of the transaction, others wait; READ-COMMITTED, no repeatable reads). Details: Consistency guarantees.
Distribution#
| Feature | State |
|---|---|
| Read-only replicas by log shipping (byte-identical logs, resume, resync after a checkpoint, manual promotion) | built |
Synchronous confirmation by N replicas with a timeout fallback (sync-replicas) | built |
| Automatic failover decided by a quorum of watchers, with an epoch and lease fence in the server | built; tested with process kills |
| Table groups: one primary per group, spread over the nodes, requests forwarded to the primary | built |
| Partitioned tables over groups | partly (placement, put/get by key, queries, indexes; no online split) |
| Moving a primary on purpose (handover) and rebalancing | built |
| Replication of accounts; changing the number of groups on a running cluster; true partitioning; cross-partition transactions | not built |
All of it is described in the replication chapter.
Access#
| Feature | State |
|---|---|
| Binary protocol and HTTP/JSON API on one port | built |
UDP transport for the binary protocol (udp) | built, measured level with TCP; opt-in |
| MySQL and MariaDB wire protocol, both password plugins | built |
| TLS on client connections of the MySQL, MariaDB, SQL Server and PostgreSQL front-ends | built (rustls); not built on the other links |
MySQL accounts, GRANT, REVOKE, SHOW GRANTS at global, database, table and column level | built |
| Studio (web tool served by the server) | built, partly verified by hand; see the studio chapter |
| Client libraries | many languages; see the connectors chapter |
Operations#
| Feature | State |
|---|---|
| One settings file, environment variables and command line with one name per setting | built |
--print-config, --check-config, init, install-service | built |
| Watcher: checks, restart, cleanup command, reports by file, command and webhook, status page | built |
| Resource control (the watcher throttles compaction and replication by foreground latency; optional cgroup limits) | built (Linux cgroups v2) |
| Fatal-error reports (local files, optional remote delivery, default off) | built |
| Backup tool, point-in-time recovery | not built |