Introduction

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#

FeatureStateNotes
JSON-native documentsbuiltA 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)builtThe whole table is in RAM; restart replays the log of each shard.
Disk-resident engine (engine = lsm)built, opt-inA 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 commitbuiltAn acknowledged write is on disk. Many writers share one fsync. Windows: the log is opened write-through (D37).
CheckpointsbuiltThe 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)builtA table of the native API can carry a schema: required, nullable, ranges. No silent type coercion anywhere (D5).
Secondary indexesbuiltHash 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 onlyA 12-byte version header and snapshot visibility, measured at 495 M checks/s. It is not connected to SQL transactions: see Transactions below.

Queries#

FeatureStateNotes
One plan for JSON filters and SQLbuiltBoth compile to the same plan (raftdb-exec, D31); same scan, same index choice, same paging.
SQL front-end for MySQL 8 and MariaDB 11built, large subsetJoins, grouping, subqueries, set operations (UNION, INTERSECT, EXCEPT), common table expressions including recursive ones, window functions, GROUP BY ... WITH ROLLUP, VALUES, TABLE.
Data typesbuiltInteger 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 operatorsbuiltJSON_EXTRACT, JSON_SET, JSON_OBJECT, JSON_CONTAINS, JSON_SEARCH, ->, ->>, MEMBER OF, and about forty more; MySQL's JSON error wording.
FunctionsbuiltA large library of string, numeric, date, regular-expression (REGEXP, REGEXP_REPLACE, ...) and aggregate functions (GROUP_CONCAT, BIT_AND, ...).
Prepared statementsbuiltThe binary protocol (COM_STMT_*) and, for MariaDB, SQL-level PREPARE / EXECUTE. Server-side cursors (COM_STMT_FETCH) are not built.
ViewsbuiltCREATE [OR REPLACE] VIEW, ALTER VIEW, DROP VIEW; simple views are updatable. WITH CHECK OPTION is stored, not enforced.
Stored procedures and functionsbuiltCREATE PROCEDURE / FUNCTION with variables, IF, CASE, loops, cursors, handlers, SIGNAL, several result sets per call. Stored events are not built.
TriggersbuiltBEFORE / AFTER INSERT / UPDATE / DELETE, FOR EACH ROW, with NEW and OLD.
Sequences (MariaDB dialect)builtCREATE SEQUENCE, NEXTVAL, LASTVAL, SETVAL, NEXT VALUE FOR.
Generated columns, check constraints, invisible columns, functional indexesbuiltStored and virtual generated columns; CHECK; INVISIBLE columns and indexes; indexes on expressions.
Foreign keysbuiltWith CASCADE, SET NULL, RESTRICT, enforced by the front-end.
Temporary tables, CREATE TABLE ... LIKE, CREATE TABLE ... AS SELECTbuilt
information_schemabuilt, partialThe 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#

FeatureState
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 serverbuilt; tested with process kills
Table groups: one primary per group, spread over the nodes, requests forwarded to the primarybuilt
Partitioned tables over groupspartly (placement, put/get by key, queries, indexes; no online split)
Moving a primary on purpose (handover) and rebalancingbuilt
Replication of accounts; changing the number of groups on a running cluster; true partitioning; cross-partition transactionsnot built

All of it is described in the replication chapter.

Access#

FeatureState
Binary protocol and HTTP/JSON API on one portbuilt
UDP transport for the binary protocol (udp)built, measured level with TCP; opt-in
MySQL and MariaDB wire protocol, both password pluginsbuilt
TLS on client connections of the MySQL, MariaDB, SQL Server and PostgreSQL front-endsbuilt (rustls); not built on the other links
MySQL accounts, GRANT, REVOKE, SHOW GRANTS at global, database, table and column levelbuilt
Studio (web tool served by the server)built, partly verified by hand; see the studio chapter
Client librariesmany languages; see the connectors chapter

Operations#

FeatureState
One settings file, environment variables and command line with one name per settingbuilt
--print-config, --check-config, init, install-servicebuilt
Watcher: checks, restart, cleanup command, reports by file, command and webhook, status pagebuilt
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 recoverynot built

See also#