Limits
The hard limits and design limits of Raft DB: names, sizes, connections, protocol and HTTP limits, SQL limits, replication limits and the things the design does not do.
Each limit below comes from a constant or a rule in the code or a decision record. Limits that are by design of the current stage are marked (stage) and may go away.
Names#
| Item | Limit |
|---|
| Database and table names (native API and HTTP) | 1 to 64 characters of letters, digits, _ and -. |
| Database and table names through the SQL front-end | Anything MySQL allows (spaces, accents, $), up to 64 characters, not ending in a space; not ., /, \ or control characters. Stored encoded; the engine's limit is 255 bytes. Names starting __rdb_, __tmp or __u_ are the front-end's own and refused. |
| Default tables | main and main.documents cannot be dropped or renamed. |
Sizes#
| Item | Limit |
|---|
| A wire frame of the binary protocol | 16 MiB (MAX_FRAME). |
| A WAL record | 1 byte to 16 MiB. |
| HTTP request body, headers | 1 MiB, 16 KiB. |
| A result page over HTTP | 10,000 documents (maxResultPage). |
| A UDP message | 16 datagrams (about 22 KB) in v2; more is TOO_BIG and the client uses TCP. A reply cache of 512 KB per UDP session. |
DECIMAL | up to 65 digits. |
| Shards per table | the shards setting, the same for all tables of a server; no resharding. |
| Table groups | 1 to 64. |
| Partitions of a partitioned table | 1 to 256 (MAX_PARTITIONS). |
| Rows | No fixed limit; the memory engine is limited by RAM. |
Connections#
| Item | Limit |
|---|
Client connections to raftdb-mysql | max_connections, default 500; one more gets error 1040. |
| Login time | 10 seconds. |
| Shared connections of the front-end to the server | raftdb_connections 0 to 64. |
Connections to raftdb-server | No fixed limit, but two threads each and no poller (stage): do not expect hundreds of thousands. |
| HTTP session token | 8 hours. A credential that passed the full password check is cached for 10 minutes (1,024 entries). |
| Prepared statements per session | 16,382; the next is error 1461. |
SQL front-end#
| Item | Limit |
|---|
| Views over views | 16 levels, then error 1462. |
| Foreign-key cascade | 15 levels deep, then error 3008. |
| A stored routine call | Stopped after 50 million statements and loop turns; recursion refused unless max_sp_recursion_depth allows it. |
| Transactions | Atomic and durable at commit, isolated one table at a time (READ-COMMITTED). |
| Character set | Statements must be valid UTF-8. |
| Collation | Case-insensitive comparison only; a binary or case-sensitive COLLATE is refused. Accents are distinguished: é is not e (MySQL's default collation equates them). |
| Unsupported statements | Error 1235; see What is not there yet. |
Storage and operations#
| Item | Limit |
|---|
| Checkpoint | Not while serving; on demand it makes the table unavailable. |
| Compaction of the memory engine's log | At start or on demand only. |
| Restart time (memory engine) | Proportional to the log's size (about 3.2 million records a second). |
| Data directory | One server process only; no lock file. |
| Indexes | Top-level fields on the native API (multi-field, nested and array indexes are not built); the SQL front-end builds composite and functional indexes of its own. Rebuilt at open. |
| Backup | No tool, no point-in-time recovery. |
Cluster#
| Item | Limit |
|---|
| Watchers in a quorum | Three or more, on separate machines. A single watcher cannot fail over. |
| Failover time | About fail_after + 2 x lease + margin: about 12 seconds with the defaults (lease 3 s), 8.5 to 11 s measured with a 3 s lease, 6 to 8 s with a 1.5 s lease in tests. |
| Primary for a group | One at a time. One decree at a time across all groups. |
| Changing the number of groups on a running cluster | Not supported. |
raftdb-server accounts | Given by user and token settings, not stored and not replicated: every node needs the same lines. |
| Reads from followers with table groups | Requests for a table led elsewhere are forwarded, never served from a follower. |
See also#