NEW RasterizedDB 1.1.0 is out: sharding and the gateway, the message broker, roles and row-level security, compression, .NET on NuGet, and the enterprise edition. What's new ›

Limits

Everything the sharding gateway and a sharded cluster do not do in this version, in one place. Each item links to the page that explains it.

Release and packaging

  • The server and gateway release archives are built with sharding, Raft and two-phase commit. rdb-shard is not part of any release archive: install it with Cargo (Install and run).

Connections and protocols

  • Clients speak PostgreSQL to the gateway. MySQL and SQL Server clients need a front-end node in between (Routing and queries).
  • The function-call protocol and replication connections are refused with 0A000.
  • Logins use SCRAM-SHA-256 (or trust for tests). Other methods (password, md5) are not offered by the gateway.
  • Client TLS is optional: the gateway cannot require it. GSSAPI encryption is declined.
  • The native front end runs with auth = trust only, as one configured role in one database, and every request is its own autocommit statement. rasterizeddb_client does not route through it (The native protocol).
  • A query string with several statements separated by ; is routed as a whole, to one shard. Send statements one at a time.

Schema

  • Schema statements (CREATE, ALTER, DROP, TRUNCATE, indexes) are refused through the gateway. Apply them with rdb-shard ddl, or rdb-shard exec to drop a table (Sharded tables).
  • A schema change is applied shard by shard, not atomically. Its tables are fenced (40001) until every shard agrees.
  • After you mark or unmark a reference table that a gateway has already routed statements for, restart that gateway.
  • Role and privilege statements go through the gateway but are applied shard by shard, not atomically, and only outside a transaction block.

Keys, uniqueness and sequences

  • A statement that names no shard key value is refused unless fan-out is turned on (unrouted = fan_out).
  • An INSERT into a sharded table must give the shard key's value. A key left to a default or a sequence is refused.
  • PRIMARY KEY and UNIQUE are checked per shard: unique across the cluster only when they include the shard key.
  • Sequences and SERIAL columns are per shard: values repeat across shards.
  • All rows of one key value live on one shard. A key value cannot be spread over several shards.

Reads across shards

  • A LIMIT without ORDER BY in a keyless read is applied by each shard, so the result can hold up to that many rows per shard.
  • ORDER BY is merged across shards only when it sorts by columns (with ASC, DESC, NULLS FIRST/LAST). A keyless read sorted by an expression is gathered onto the home shard instead, which copies every sharded table it names.
  • Window functions, UNION, INTERSECT and EXCEPT over a sharded table are computed across shards only inside a subquery or CTE, which is gathered (Routing and queries).
  • SELECT ... FOR UPDATE without a key is refused.
  • A gathered statement copies every sharded table it names, whole, onto the home shard, up to gather_max_bytes (256 MiB), then fails with 54000. Filters are not pushed down to the shards first.
  • A prepared statement that fans out or gathers must be alone in its batch.
  • Without SET rdb.consistent_fanout = on, each shard reads at its own snapshot, so a transaction that committed on several shards may show on some and not others.

Writes and transactions

  • Without two_phase = on, a transaction writes on one shard; a multi-row INSERT whose rows span shards is refused; a keyless write needs SET rdb.unrouted_writes = each_shard and is not atomic.
  • Two-phase commit needs shards built with sharding_2pc.
  • All Binds in one extended-protocol batch must reach one shard.
  • A statement whose shard connection is lost after sending fails with 08007, outcome unknown; it is not retried.
  • Two-phase transactions caught by a crash stay prepared, with their rows locked, until rdb-shard resolve runs (High availability).

COPY

  • COPY ... FROM STDIN into a sharded table is split by row only in text or CSV format, and only under two_phase = on (atomic) or with SET rdb.split_bulk_writes = on in autocommit (not atomic). Binary format is refused.
  • COPY into a reference table needs two_phase = on.
  • COPY ... TO STDOUT from a sharded table is refused. Read it with SELECT.

LISTEN, NOTIFY and the Redis protocol

  • Notifications reach a listening session while it is idle, read from the shards about every 100 ms.
  • Through the Redis protocol, a command whose keys are on several shards gets -CROSSSLOT. KEYS, SCAN, FLUSHALL, INFO, CONFIG, publish/subscribe and MULTI are refused.
  • Moving a range does not move its cache entries.

Moving data

  • Moves are started by an operator, by a gateway's REBALANCE CLUSTER, or by rdb-shard rebalance --every.
  • A move must carry every partitioned table; a tenant must first have partitions of its own on its shard (ISOLATE KEY).
  • Writes to the moving rows pause while the source is fenced.
  • No command removes a shard from the map.
  • After a move between shards the source keeps its old copy of the moved rows, unread.
  • No program rewrites map files on disk. Copy the newest map to every shard and gateway before restarting them (Moving data).
  • Each shard backs up on its own, to its own prefix; there is no backup or restore of the whole cluster at one point, and a shard's backup cannot be restored across a later move.

Availability

  • A shard that is down makes its keys, and every statement that needs all shards, unavailable until it is back.
  • The home shard is needed for logins (once the cache expires), new statement shapes, plain tables, cross-shard aggregates, and two-phase commit decisions.
  • Per-shard Raft replicas are a preview: the gateway connects only to the map's address and does not follow a new leader. The map's standby addresses are not used by the gateway (High availability).

Administration

  • The metrics endpoint has no authentication; neither it nor the configuration API has TLS.
  • Gateway settings are read at start. Changes, including those stored through the configuration API, apply after a restart.
  • Per-user shards need the enterprise gateway (Per-user shards).
✓ page rendered in 118 µs axum + tera + htmx · no other javascript