Introduction
RasterizedDB is a relational database written in Rust that speaks the PostgreSQL wire protocol, so psql, PostgreSQL drivers and ORMs connect to it unchanged. This page explains what it is, which product to use for what, and where to read next.
What RasterizedDB is
- SQL in PostgreSQL's dialect: tables with typed columns, joins, aggregates, window functions, subqueries, views, sequences, functions and triggers. See Querying and PostgreSQL compatibility.
- Transactional: MVCC snapshots,
BEGIN/COMMIT/ROLLBACK, savepoints,READ COMMITTEDandREPEATABLE READ. See Transactions. - Crash-safe: every write goes through a write-ahead log. A crash or power loss loses no committed transaction under the default
synchronous_commit = on. - Indexed two ways: B-tree, hash, GIN and JSON path indexes, plus a bit-sliced filter index that every scan consults to skip rows that cannot match. See Indexes.
- Several databases per server, each with its own roles, tables and log. See Databases.
- Operations built in: replication between servers, continuous backup to S3-compatible storage with point-in-time restore, database branches, several storage directories per database, and a Redis-compatible key/value store.
The products
| Product | What it is | Status |
|---|---|---|
Server (rasterizeddb) | The database server. Runs on Linux and Windows, x86-64 and ARM64, or in Docker. | Released, 1.1.0 |
Studio (rdb-studio) | A desktop console: dashboard, schema and data browser, SQL editor, activity, backups, replication, roles and configuration. Also works against PostgreSQL. | Released, 1.1.0 |
Rust client (rasterizeddb_client) | A Rust client over the server's native protocol, with an ORM layer, migrations and typed admin calls. | Released, 1.1.0 |
Embedded engine (rasterizeddb_embedded) | The whole database as a Rust library, running inside your own process with no server. | Released, 1.1.1 |
.NET client (RasterizedDb.Data, RasterizedDb.EntityFrameworkCore, RasterizedDb.Messaging) | An ADO.NET driver, an Entity Framework Core provider and a message broker client over the native protocol, on NuGet. | Released, 1.1.0 (RasterizedDb.Messaging pre-production) |
Sharding gateway (rasterizeddb-gateway) | Spreads tables across several servers by key and routes each statement to the server that owns it. | Released, 1.1.0 |
| Enterprise server | The server with strict tenant isolation, policy-driven data placement and per-user shards, for running a database service for others. | Released, 1.1.0 |
The server, Studio and clients are licensed under the GPL 3.0. The enterprise components have their own licence.
Which one to use
- An application in any language, with an existing PostgreSQL driver or ORM: run the server with the PostgreSQL protocol on and connect with your driver. Nothing RasterizedDB-specific is needed. See Connecting.
- A Rust application talking to a server: use the Rust client. It speaks the native protocol, which is cheaper per statement than the PostgreSQL protocol and carries the engine's own types.
- A Rust application that should carry its database inside it (a desktop app, a test suite, a single-binary service): use the embedded engine. No server, no network, the same SQL.
- A .NET application: use the native .NET client, or any PostgreSQL driver such as Npgsql.
- An application written for MySQL or SQL Server: the server also speaks those protocols. See MySQL and SQL Server clients.
- More data or write load than one server holds: start with replication, then the sharding gateway.
- Running databases for many tenants: see the enterprise overview.
Protocols the server speaks
One server process can serve all of these at once, on the same databases and the same roles.
| Protocol | Default port | Turned on by | Used by |
|---|---|---|---|
| PostgreSQL wire protocol (v3) | 5432 | --protocol pgwire or --protocol both | psql, libpq, JDBC, Npgsql, sqlx, tokio-postgres, node-postgres, psycopg, ORMs |
| Native protocol (rastcp) | 61170 | --protocol rastcp (the default) or --protocol both | rasterizeddb_client, the .NET client, Studio |
| MySQL / MariaDB client protocol | none (3306 is MySQL's) | --mysql-port or --mysql-socket | mysql, MySQL drivers and ORMs |
| SQL Server (TDS) | none (1433 is SQL Server's) | --mssql-port or --mssql-socket | sqlcmd, Microsoft.Data.SqlClient, EF Core, tiberius |
| Redis (RESP) | none | --kv-port or --kv-socket | redis-cli and Redis clients, for the built-in key/value store |
| Replication | 61171 | --replication | other RasterizedDB servers |
The server's default is the native protocol alone, on localhost. Most setups want --protocol both, which is what the Docker images and the Arch package's service use.
The server also has a message broker with its own protocol and Kafka, AMQP 0-9-1 and MQTT listeners, all off unless their ports are given. See Message broker.
Where to go next
- Install the server, or run it in Docker.
- Run it for the first time and set its password.
- Connect with
psqlor your driver. - Create tables, query and change data.
- Before production: Security, Backup and restore, Monitoring and Configuration.
If something does not work, see Troubleshooting.