DOCS
Use it, end to end.
How to install, run, connect to and operate every part of RasterizedDB: the server, the enterprise edition, the embedded engine, the Rust and .NET clients and the sharding gateway. Plus scripts and Docker recipes you can run as they are.
PRODUCTS
RasterizedDB ServerInstall, run, configure and use the database server: SQL, storage, replication, backups and operations.34 pages →EnterpriseStrict tenant isolation for database-as-a-service, data segregation across shards, and per-user shards.10 pages →Embedded engineRun the engine inside a Rust application, with no server and no network.5 pages →Rust clientThe native-protocol client and ORM for Rust: queries, models, migrations, transactions, KV.13 pages →C# / .NET clientThe ADO.NET driver and the EF Core provider for .NET.10 pages →Sharding gatewaySpread one database across machines: shards, the gateway, routing and rebalancing.9 pages →Setup scriptsReady-to-run Bash and PowerShell scripts for every way to set up the server.20 pages →Docker recipesReady-to-run docker run scripts and Compose files, from one container to a replicated pair.12 pages →
RASTERIZEDDB SERVER
IntroductionWhat RasterizedDB is, the seven products and which to choose, the protocols and ports it speaks, and where to go nextInstallRelease archives per platform and CPU, Docker in brief, the Arch package, building from source, and every Cargo feature with its defaultRunning the serverFirst start and the bootstrap role, the data directory and its lock, systemd and Windows, clean shutdown, exit codes and loggingConfigurationEvery command-line flag by area, environment variables, rasterizeddb.conf and its precedence, every SET CONFIG key, and the session settingsConnectingEvery protocol and port, TLS modes, unix sockets, connection strings for psql/JDBC/Npgsql/sqlx/tokio-postgres/node-pg/psycopg, MySQL/SQL Server/Redis clients, and selecting a databaseSecurityA production checklist, per-database roles, role statements, authentication methods per listener, GRANT/REVOKE, superuser-only statements, row-level security and TLSDatabasesCreating, listing, selecting, copying and dropping databases, their SQLSTATEs, and what belongs to one database versus the whole serverTables and data typesCREATE/ALTER/DROP TABLE, CREATE TABLE AS, temp tables and TRUNCATE; every column type with its range (numbers, text, bytea, dates and times, uuid, network, bit, geometric, arrays, ranges, enums, domains); every constraint and foreign-key action; serial, identity and generated columnsQuerying dataSELECT end to end: filtering, sorting and paging (LIMIT/FETCH, keyset), DISTINCT ON, every join kind and LATERAL, subqueries, CTEs incl. recursive, GROUP BY/ROLLUP/CUBE, set operations, window functions and frames, row values, CASE, casts, TABLESAMPLE, PREPARE/EXECUTE, and the refused formsFunctions and operatorsEvery built-in scalar, string, math, date/time, array, range, UUID, JSON, sequence, aggregate, window, set-returning and session function, plus every operator, with argument forms, return types and limitsModifying dataINSERT (multi-row, DEFAULT, INSERT…SELECT, identity OVERRIDING), RETURNING, ON CONFLICT upserts and their targets, UPDATE (incl. multi-column SET and FROM), DELETE (incl. USING), MERGE, data-modifying CTEs, COPY with its full options table, and limitsTransactionsBEGIN/COMMIT/savepoints, the two isolation behaviours, 40001 handling with a retry loop, row and table locks, timeouts, synchronous_commit, and which DDL rolls backIndexesCREATE/DROP INDEX (btree, hash, GIN, unique, JSON path, full-text), what is accepted but not built, reading index use from rows_scanned, tuning the filter index, and index storage (snapshot, residency)JSON and JSONBDeclaring json/jsonb columns, how the two types differ, every operator, the functions (build, inspect, modify, aggregate, expand into rows), path and GIN indexes, and the --json-shadow-tables storage choiceFull-text search and collationsto_tsvector/to_tsquery and @@, query syntax, the english and simple configurations, ts_rank, GIN full-text indexes, MySQL/SQL Server MATCH/CONTAINS pointer, and case- and accent-insensitive collations (rdb_ci, rdb_ci_ai, citext) and what follows themSchemas, views and other objectsSchemas (one namespace), views and materialized views, sequences, SQL functions, procedures, DO blocks, triggers and the PL/pgSQL they run, enum types, domains, row-level security, comments, and the information_schema/pg_catalog relations that list themPostgreSQL compatibilityWhat a PostgreSQL app, driver or tool gets (protocol features, reported parameters, tested clients), moving an app over, prepared statements after schema changes, LISTEN/NOTIFY, EXPLAIN, session settings, what is accepted without effect, what is not supported, and the known differencesPartitioningCreate hash-partitioned tables, see which queries touch one partition, convert, reshape (split/merge/isolate/split key), move and rebalance partitions, and tune open/idle settingsStorage poolsSpread one database over several directories or disks with flags or STORAGE statements: placement policies, mirrored backup locations, moving, draining and rebalancing tablesKey/value storageDefine S3 or directory stores, place or convert tables and partitioned tables onto them, tune and rotate them, and know their backup coverage, costs and limitsKey/value cache (Redis protocol)Turn on the Redis-compatible store: flags, auth and TLS, KV statements from SQL with result columns, eviction, persistence, replication, the full command tableCompressionPer-column and per-row zstd: levels, COMPRESSION and row_compression syntax, RECOMPRESS and VACUUM (FULL, RECOMPRESS), automatic dictionaries, catalogue views and SHOW TABLE STATS metrics, the ORM deriveMessage brokerTopics, queues, subscriptions and exchanges: every server flag (broker, Kafka, AMQP, MQTT), the full BROKER SQL statement set with options and defaults, grants, client examples, replicationReplicationSet up multi-primary nodes with pinned or CA certificates, every flag and REPLICATION SET key, monitoring lag and REPLICATION CHECK, conflicts, reseeding a node, failure handling, and what does and doesn't replicateBackup and restoreTurn on S3 backups (AWS, MinIO, RustFS, others), every backup and restore flag, the BACKUP/RESTORE/SHOW statements, retention, point-in-time recovery, the three restore paths, the prefix guard when wiping a database, offline start and the staging ceilingBranchingCreate branches (now or AS OF a past point), SHOW BRANCHES, diff, three-way merge with its conflict options, reset/promote/drop, branches of branches, disk use and limitsMaintenance: VACUUM, compaction and disk spaceWhat reclaims space automatically, VACUUM / VACUUM FULL, tuning auto-compaction (incl. partitions), reading table space stats, checkpoints and WAL flagsMonitoringHealth checks, every SHOW statement, SHOW QUERIES and pg_stat_statements, EXPLAIN [ANALYZE], the catalogue and stats views, logs, and what to watchImport from PostgreSQLMigrating a live PostgreSQL database with IMPORT DATABASE or the --pg-import-* flags: dry run, every option, type mapping, what does and doesn't come across, the JSON and wide-NUMERIC traps, pg_dump the other wayMySQL and SQL Server clientsTurning on the MySQL and TDS listeners, every flag, connecting with mysql/sqlcmd/SqlClient, what each dialect translates, what front-end-only features exist, what is refusedDockerImage names and tags, running and passing flags, your own certificate, Compose, stopping, the RustFS all-in-one image, and building an image yourselfStudioInstalling and starting rdb-studio, connection profiles, TLS and saved passwords, and every screen with what it does against PostgreSQLUpgradingRelease channels, the upgrade procedure (Docker and replicating clusters included), downgrade refusals, and the release notes that need actionTroubleshootingStart-up refusals, connection and TLS failures, and statement errors by SQLSTATE, each with what it means and what to do
ENTERPRISE
Enterprise editionWhat the enterprise server and gateway add over the GPL edition, the licence terms in brief, and how to request itInstalling the enterprise editionInstall the enterprise binaries from the release archives or build them from source, start them with --enterprise-config and the enterprise gateway flags, and what the release archives containEnterprise configurationEvery directive of the enterprise server's file with defaults and an annotated example, the tenant and hosted-role files it keeps, the enterprise gateway's flags and the routes fileTenantsStrict tenant mode: what it refuses, CREATE/ALTER/DROP/SHOW TENANT, per-tenant limits, the outbound host allowlist, and a worked setup for a database-as-a-service operatorData segregationShard labels and placement policies over block ranges, the exact placement rules including exclusive, finding a key's block, and a worked example keeping a customer on EU shardsPer-user shardsRouting a login to its own shard: the routes file, the user_routing modes, SHARD HOST/UNHOST ROLE, the routes/customers/clients API with every reply, and the client statistics and their metricsLedger tablesCreate append-only or VERSIONED ledger tables: retention, legal holds, what each statement does, the hash chain and where it lives, dir:/S3 anchors and their settings, signed anchors, trusted time, receipts, privileges, replication/backup/branch behaviourVerifying a ledgerVERIFY LEDGER output and findings, ACKNOWLEDGE LEDGER ROLLBACK after a restore, rdb-ledger-verify (every flag, output, exit codes, signed anchors), running it on a scheduleSecret vaults and keysCREATE VAULT, key providers (pkcs11:, mlkem:, file:, tpm:), the VAULT statements, states, purge, keys used in place, key rotation, audit, privileges, files to back up, the Studio LEDGER pageEncrypted columnsDeclaring ENCRYPTED WITH VAULT columns, what may and may not name them, who sees plaintext, keys and rotation, replicas, limits
EMBEDDED ENGINE
The embedded engineWhat running the engine in-process means, embedded vs server, what is the same and different, one engine per process and the directory lock, platforms and CPUGetting started with the embedded engineCargo.toml (crates, versions, client features), a minimal program, a realistic to-do program with expected output, building for x86-64-v3, seeing the engine's logThe BuilderEvery Builder setting with its server flag or key, default and effect; config(key, value) and every key it takes; hot vs read-once keys; process-wide settings; enums; Cargo features; the Embedded handle's methodsUsing the embedded engineSharing one client, queries, transactions, ORM, migrations, KV, client options vs request_timeout, several databases, background work, signals, shutdown and drop order, programs without an async runtimeTesting with the embedded engineOne engine per process, the lock pattern for tests in one file, temp directories and drop order, tests that change settings, blocking tests, CI and cleanup
RUST CLIENT
Getting started with the Rust clientCargo.toml and features, making the server reachable, a first query, a first model, sharing one clientConnectingEvery Options field with defaults; Trust/Peer/PeerAs/Password logins; TLS pinning, private CA, web roots; database selection; connections; timeouts; reconnects; the 1.1.0 trust-role changeQueriesThe query calls, $n parameters and quoting helpers, reading rows by position, many-row writes, notices, the simple-query form, sessions and cancellingTypesThe full Rust/SQL type table, NULL and Option, Numeric, floats, JSON/JSONB, points in time, UUIDs, arrays, Value, SqlEnum, your own ToSql/FromSql typesTransactionsbegin/commit/rollback, the retrying closure, isolation, row locks, savepoints, SQLSTATEs in transactions, connection loss, the idle limit, the Executor traitThe ORM#[derive(Model)] and every attribute, CRUD, upserts, update_many, optimistic locking, timestamps, soft delete, hooks, partitioned tables, the query builder, aggregates, keyset pages and streamsRelationshas_many/has_one/belongs_to/many_to_many/count_of, eager and lazy loading, where_has, attach/detach/sync, foreign keysMigrationsThe Migrator, migrating on connect (Apply/Verify/Off), plan/status/rollback, step kinds, scenarios (baseline, locks, out of order), SyncPolicy model syncKey/value cache from RustUse the server's Redis-compatible cache from Rust: typed values and maps, TTLs, counters, closure queries, models stored as hashes, the ORM's read-through cache with invalidation, caching patterns, a full API reference, errors and limitsMessage broker clientConnect to the built-in broker from Rust: topics, queues, exchanges, the batching producer, push subscriptions with acks, offsets and dead letters, fetch, models as messages, error codes, full option tables with defaultsAdministration APITyped client.admin() calls for stores, table placement, indexes, partitions, tables and stats, config, roles and grants, backups/restore and replication: the statement each sends and what it returnsClient-side shardingSpread tenants over several ordinary servers from Rust: write the shard map, connect a Router, route models with shard_by, merge fan-out reads, run one-shard transactions, move or roll back a tenant with rdb-shard, and handle the six sharding errorsErrorsEvery Error variant, the is_… checks, when a SQLSTATE is available, what to retry, handling patterns
C# / .NET CLIENT
Getting started with the .NET clientSupported .NET versions, installing the packages from NuGet (or from source), and a first ADO.NET and EF Core programConnecting from .NETEvery connection-string keyword with aliases and defaults, logins, TLS trust modes and engines, unix sockets, database selection, pooling, data sources and DI registrationCommands and parametersRunning statements, placeholders and parameter types, multi-statement commands, batches, multiplexed data-source commands, bulk inserts, timeouts, cancellation and noticesReading resultsThe data reader, text vs binary result formats, the SQL-to-.NET type table, and how NULLs, NUMERIC, JSONB, timestamps, intervals, bytes and arrays readTransactions in .NETStarting and ending transactions, isolation levels, savepoints, conflict errors with ExecuteInTransactionAsync and a manual retry pattern, and lost transactionsAdministration from .NETEvery connection.Admin call (tables, indexes, partitioning, roles and grants, config, stores and placement, backups, replication) with the statement it sends, what it returns, and who may run itKey/value cache from .NETEvery connection.Kv call (strings, counters, hashes, lists, sets, sorted sets, raw commands) with TTLs, plus typed maps, map queries and object repositoriesMessaging from .NETRasterizedDb.Messaging (pre-production): connecting, queues, topics and subscription modes, ack/nack/renew, scheduled delivery, batches, exchanges, durability, errors and reconnectingEF Core providerInstalling the provider, UseRasterizedDb overloads and options, type mapping, HiLo/array/JSON columns, migrations and their lock, scaffolding, LINQ translations and gapsLimits and differences from NpgsqlWhat the driver lacks, what degrades against an older 1.0.1 server, differences from Npgsql, and when to use Npgsql over the PostgreSQL listener
SHARDING GATEWAY
Sharding and the gatewayWhat shards, the shard map, the route function and the gateway are, when to shard, and what clients seeInstall and run a clusterGet the three binaries from the release archives and Cargo, and run a complete three-shard cluster plus gateway, with the map format and TLS between every pieceConfigurationEvery gateway setting with its default, every shard flag, the shards' run-time settings and the rdb.* session settingsSharded tablesSharded, plain and reference tables, choosing a shard key, uniqueness and sequences, schema changes with rdb-shard ddl, roles through the gatewayRouting and queriesWhat runs on one shard, what fans out or is gathered, transactions, prepared statements, COPY, LISTEN/NOTIFY, native, Redis and MySQL/SQL Server access, error codesMoving dataMoving a tenant, rebalancing (from the tool or REBALANCE CLUSTER), adding a shard by split, what clients see during a move, and the rdb-shard reference for shard clustersHigh availabilityWhat happens when a shard, the home shard or a gateway is down, finishing prepared transactions with rdb-shard resolve, and the Raft previewAdministrationSHOW GATEWAY and every counter, the metrics endpoint, health checks, the configuration API, logs, upgrading without downtime, cluster backup and restoreLimitsEverything the gateway and a sharded cluster do not do, in one list
SETUP SCRIPTS
Install the serverDownload, checksum-verify and install the newest release for this OS and CPU, or install from a local archiveTLS certificatesA private CA and a server certificate as PEM files, with openssl or .NET, and how clients verify themA local development serverOne server on 127.0.0.1, PostgreSQL and native, no TLS, in the foregroundA production server on one machineBoth protocols on the network with your certificate, started at boot (systemd, or a Windows task plus firewall rules)Run as a systemd serviceInstall the server as a hardened systemd unit with its own user, env file and data directoryRun at Windows startupStart the server at boot as SYSTEM from a scheduled task, since it is not a Windows serviceEvery protocol from one serverPostgreSQL, native, MySQL, SQL Server and Redis on one server with TLS, and a client command for eachUnix sockets onlyPostgreSQL and native over unix sockets with no TCP port, password and peer loginsA Redis replacementThe Redis protocol with a memory limit, LRU eviction, optional persistence and TLSContinuous backups to S3Scheduled snapshots and log archiving to any S3-compatible store, and on-demand backupsRestore from S3Restore to the newest point, a time, an LSN or a snapshot, into a new or moved-aside directoryTwo replicated nodesTwo writable nodes replicating over pinned-certificate TLS, set up in two passesAdd a replica to a running serverSeed a second node from the existing server's S3 backup, reset both replication histories, start the pairSeveral disks for one databaseExtra primary directories, a mirror directory and a placement policy, and managing them in SQLTables stored in S3Define an S3 key/value store and place or move tables onto itImport a PostgreSQL databaseOne-shot import of a live PostgreSQL schema into a new database, with dry runA message broker in the databaseNative, Kafka, AMQP and MQTT ports on the database's roles, checked from SQL and kcatOne server, many customersEnterprise strict tenant mode: the config file, starting it, and creating tenants with limitsA sharded cluster on one machineThree mTLS shards, a shard map, a sharded table and a gateway, all in the backgroundPer-user shardsEnterprise shards and gateway where each customer's login is pinned to one shard, added through the API
DOCKER RECIPES
Single containerRun the server with docker run (bash and PowerShell), with the image tags, what the image does, and checking and cleaning upCompose basicOne server under Compose with a named volume, a healthcheck and a restart policyCompose with TLSYour own CA and server certificate on the PostgreSQL and native protocols, verified with sslmode=verify-fullAll protocolsPostgreSQL, native, MySQL, SQL Server and Redis listeners on one server, with a client command for eachKV cache (Redis replacement)The Redis-compatible store with a memory limit, eviction and snapshots, plus a redis-cli helperApplication stackA sample Python app and the database, connected by service name through the libpq environment variablesCompose with S3 backupsContinuous backup to a RustFS sidecar (or AWS S3 and others), checking that a backup restores, and the full restore procedureRustFS all-in-oneThe rustfs image: backups and S3-backed tables in one containerCompose with replicationTwo multi-primary nodes with pinned-certificate authentication, set up by an identity scriptImport from a PostgreSQL containerA seeded PostgreSQL 17 source, a one-shot import service and the server, plus the SQL formBacking up the volumeScripts that stop the server, archive the volume safely, and restore an archive into a new volumeUpgradingScripts and Compose steps to move to a new tag and keep the volume, one node at a time for a replicated pair, and how to go back