Internals

Decisions D40 to D88 in short

A one-paragraph summary of each design decision from D40 (UDP transport) to D88 (triggers), in order, with a pointer to the page that explains the mechanism.

This is a summary in the words of this documentation of the decisions recorded in the decision log from D40 to D88. The full text, with the measurements and rejected alternatives, is in the log; the design decisions chapter has the reasons behind the main choices. Decisions are numbered in the order they were written, not always the order they were made.

Server, replication and control plane (D40 to D51)#

DecisionSummary
D40A UDP transport for Ping, Use, Get, Put, Delete and Filter in single datagrams of at most 1,400 bytes, authenticated, with sessions obtained over TCP and a hybrid client that falls back to TCP. See raftdb-server.
D41A separate watcher restarts and cleans up only what is basic and safe, and reports everything. See Watcher.
D42Automatic failover with Raft inside the server, tested with kill -9; later removed by D51 C4.
D43The disk-resident LSM engine, so restart time and capacity do not depend on RAM. See LSM.
D44, D45A first run with no flags, profiles and one settings file; install-service.
D46 to D49Server tables on the LSM engine (opt in), their replication and failover, their secondary indexes, and the read-path work that closed the gap to the in-memory engine from 2.6 times to 1.27 times.
D50Partitions with a group each, built in layers: groups with a primary each under the watcher, forwarding, then partitioned tables. See Raft.
D51The control plane lives in the watcher; the database keeps only a fence (epoch and lease). Steps C1 (fence), C2 (watcher quorum), C3 (resource control), C4 (election removed from the server). The watcher costs the data path no latency (measured).

MySQL front-end, correctness (D52 to D61, D64)#

DecisionSummary
D52MySQL compatibility is a connector, one crate per database; only missing features go into the core. Levels 1a (protocol), 1b (tables and rows), 1c (prepared statements), 2a (unique keys through claim tables), 2b (information_schema).
D53Fatal-error reports (raftdb-report), default off.
D54MySQL accounts and privileges, stored in the hidden database __rdb_accounts.
D55, D56The general SELECT executor; ALTER TABLE, multi-table writes, INSERT ... SELECT.
D57Transactions that are atomic but not isolated. See MVCC.
D58Indexed reads through pushdown; DECIMAL up to 65 digits, ENUM, SET, BLOB, BINARY.
D59 to D61The function library, regular expressions, CAST; each front-end shows only its own databases; gaps closed against real MySQL 9.7 for PrestaShop, SQLyog and phpMyAdmin.
D64Foreign keys with enforcement, BIT, fractional seconds; a 15 MB application dump loads and round-trips (47 tables with rows, 74,878 rows, identical to real MySQL).

MySQL front-end, performance (D62, D63, D65 to D69)#

DecisionSummary
D62, D63, D65The first measurement against MySQL 9.7 and the definition cache; bounds on one field as one index range; the planner no longer lists half the table, rows are read in binary, one connection per table.
D66, D67Reads on the connection's thread, the server inside the front-end (embed), rows sent together: level with or ahead of MySQL in one process, which becomes the default way to run.
D68An allocation cache per thread, a bounded look before a blocking receive, a join's tables read at once.
D69Protocol version 2 (streams, fields instead of rows, one wait for the disk); the sessions' reads by key share a connection.

See Pushdown and the executor.

MySQL front-end, features (D70 to D78, D83 to D88)#

DecisionSummary
D70, D71, D72Views; CREATE TABLE ... LIKE and AS SELECT; temporary tables.
D73 to D77CHECK constraints; generated columns; invisible columns and indexes; functional indexes; the rules for what those may contain and the index answering the expression.
D78The type of an expression is worked out as MySQL does (exprtype.rs). See Expressions and types.
D83ANALYZE, OPTIMIZE, CHECK and REPAIR TABLE answer as a healthy InnoDB table; the regular-expression functions.
D84GROUP BY ... WITH ROLLUP; the JSON operators ->, ->> and MEMBER OF.
D85Row comparisons, ANY / SOME / ALL, standard SUBSTRING and FETCH forms, X'..' literals, names that start with digits.
D86Any table name MySQL allows (stored encoded), MySQL's JSON error words, the real character-set and collation lists, a stale-binding fix.
D87, D88Stored procedures and functions with several result sets; triggers. See Routines and triggers.

Two dialects (D79 to D82)#

DecisionSummary
D79One program, two dialects (dialect = mysql or mariadb), with identification as MariaDB 11.
D80MariaDB connectors, error wording, big integers and exact decimals; the statement-level coverage harness.
D81System variables, SQL-level PREPARE, OR REPLACE and IF [NOT] EXISTS, RETURNING, sequences, expression defaults.
D82Other type names, UUID / INET4 / INET6, 60 more functions, the JSON functions, more aggregates.

See Dialects.

How the decisions were checked#

Each of these decisions was checked by running a script through the real client against both Raft DB and a real MySQL server, or by a test in the crate. The decision text records which scripts were identical and which differences remain. This page does not repeat those results.