---
id: "sql-database"
type: "kind"
category: "data"
url: "https://localhost:3000/catalogue/kinds/sql-database"
---

# SQL database

Relational datastore, usually the system of record.

| | |
|---|---|
| Category | Data |
| Properties | 16 |
| Components | 76 |
| Rules | 6 |

## Properties

| property | type | values | required | default |
|---|---|---|---|---|
| `appendOnly` (advanced) | boolean | — | no | false |
| `backupEnabled` | boolean | — | no | false |
| `backupRetentionDays` | integer | — | no | — |
| `commitProtocol` (advanced) | enum | `single`, `two-phase` | no | "single" |
| `concurrencyControl` (advanced) | enum | `pessimistic`, `optimistic`, `constraint` | no | — |
| `distributed` | boolean | — | no | false |
| `encryptionAtRest` | boolean | — | no | false |
| `idEncodesShard` (advanced) | boolean | — | no | false |
| `instances` | integer | — | no | — |
| `managed` | boolean | — | no | false |
| `multiWriter` | boolean | — | no | false |
| `replicaFanout` (advanced) | integer | — | no | — |
| `replicaOf` | ref | — | no | — |
| `replication` | enum | `none`, `async`, `sync` | no | "none" |
| `shardKey` | string | — | no | — |
| `sharded` | boolean | — | no | false |

## Rules for this kind · 6

### Database updates not propagated to the search index `business-updates-without-index-propagation` (warning)

- Page: https://localhost:3000/catalogue/rules/business-updates-without-index-propagation.md
- Why: Application servers write this database and the design keeps a search index, but nothing captures the database's changes. The index then depends on the application writing to both places, and the two drift apart silently.
- Applies to: every node of kind sql-database
- Message: Database '{{node.id}}' is written by application servers and the design has a search index, but no change-data-capture propagates its updates. Index writes rely on dual writes.

It fires when:

- all of these hold:
  - the node has at least one synchronous incoming edge from an app-server
  - the design contains a node of kind search-index
  - this does not hold:
    - the node has at least one outgoing edge to a change-data-capture

### Datastore without backup or retention `datastore-missing-backup` (error)

- Page: https://localhost:3000/catalogue/rules/datastore-missing-backup.md
- Why: A system of record with backups off, or with no retention period stated, cannot be restored. The loss is discovered on the day it matters.
- Applies to: every node of kind sql-database
- Message: Datastore '{{node.id}}' has no backup or no retention policy declared.

It fires when:

- any of these hold:
  - the node's `backupEnabled` is false
  - the node's `backupRetentionDays` has no value

### Single-region datastore behind a multi-region SLA `datastore-single-region` (error)

- Page: https://localhost:3000/catalogue/rules/datastore-single-region.md
- Why: The design promises multi-region availability, but this datastore sits in one region and does not replicate. A region outage takes the system of record with it.
- Applies to: every node of kind sql-database
- Message: Datastore '{{node.id}}' is single-region with no replication, but the design requires multi-region availability.

It fires when:

- all of these hold:
  - the design requirement `availability.multiRegion` is true
  - the node sits inside exactly 1 region group
  - the node's `replication` is "none"

### Read-heavy datastore without a cache `read-heavy-path-without-cache` (warning)

- Page: https://localhost:3000/catalogue/rules/read-heavy-path-without-cache.md
- Why: The design states a read-heavy workload and application servers read this datastore directly, yet the design has no cache anywhere. Every read pays a database round trip.
- Applies to: every node of kind sql-database or nosql-database
- Message: Datastore '{{node.id}}' serves a read-heavy workload directly from application servers and the design has no cache.

It fires when:

- all of these hold:
  - the design requirement `traffic.readWriteRatio` is a number greater than 10
  - the node has at least one synchronous incoming edge from an app-server
  - this does not hold:
    - the design contains a node of kind cache

### Read replicas as the only scaling `read-replica-as-sole-scaling` (warning)

- Page: https://localhost:3000/catalogue/rules/read-replica-as-sole-scaling.md
- Why: Asynchronous read replicas scale reads only. When the store is neither sharded nor distributed the writes still land on one primary, so the replicas add nothing at the declared peak.
- Applies to: every node of kind sql-database
- Message: Database '{{node.id}}' relies on async read replicas as its only scaling above 5000 rps. Replicas do not scale writes.

It fires when:

- all of these hold:
  - the node's `replication` is "async"
  - the node's `sharded` is false
  - the node's `distributed` is false
  - the node's declared requests per second is more than 5000

### Single-writer primary at peak QPS `single-writer-primary-at-peak-qps` (error)

- Page: https://localhost:3000/catalogue/rules/single-writer-primary-at-peak-qps.md
- Why: A single-writer, unsharded relational primary has a throughput ceiling. Declaring more than five thousand requests per second against it means the peak finds that ceiling in production.
- Applies to: every node of kind sql-database
- Message: Database '{{node.id}}' is a single unsharded writer declared at more than 5000 rps. Shard it or move to a multi-writer distributed store.

It fires when:

- all of these hold:
  - the node's `multiWriter` is false
  - the node's `sharded` is false
  - the node's declared requests per second is more than 5000

## Components · 76

### vendor-neutral

- [Generic SQL database](https://localhost:3000/catalogue/components/sql-database.md) `sql-database` — the kind itself

### alibabacloud

- [ApsaraDB for OceanBase](https://localhost:3000/catalogue/components/alibaba-oceanbase.md) `alibaba-oceanbase` — 2 defaults
- [PolarDB](https://localhost:3000/catalogue/components/alibaba-polardb.md) `alibaba-polardb` — 2 defaults
- [PolarDB-X](https://localhost:3000/catalogue/components/alibaba-polardb-x.md) `alibaba-polardb-x` — 6 defaults
- [ApsaraDB RDS](https://localhost:3000/catalogue/components/alibaba-rds.md) `alibaba-rds` — 1 defaults

### aws

- [Amazon Aurora](https://localhost:3000/catalogue/components/aurora.md) `aurora` — 5 defaults
- [Amazon Aurora DSQL](https://localhost:3000/catalogue/components/aws-aurora-dsql.md) `aws-aurora-dsql` — 6 defaults
- [Oracle Database@AWS](https://localhost:3000/catalogue/components/aws-oracle-database.md) `aws-oracle-database` — 2 defaults
- [Amazon RDS](https://localhost:3000/catalogue/components/aws-rds.md) `aws-rds` — 5 defaults
- [Amazon RDS Custom](https://localhost:3000/catalogue/components/aws-rds-custom.md) `aws-rds-custom` — 5 defaults

### azure

- [Azure Database for MySQL](https://localhost:3000/catalogue/components/azure-database-for-mysql.md) `azure-database-for-mysql` — 5 defaults
- [Azure Database for PostgreSQL](https://localhost:3000/catalogue/components/azure-database-for-postgresql.md) `azure-database-for-postgresql` — 5 defaults
- [Azure HorizonDB](https://localhost:3000/catalogue/components/azure-horizondb.md) `azure-horizondb` — 5 defaults
- [Oracle AI Database@Azure](https://localhost:3000/catalogue/components/azure-oracle-database.md) `azure-oracle-database` — 1 defaults
- [Azure SQL Database](https://localhost:3000/catalogue/components/azure-sql.md) `azure-sql` — 6 defaults
- [Azure SQL Managed Instance](https://localhost:3000/catalogue/components/azure-sql-managed-instance.md) `azure-sql-managed-instance` — 6 defaults
- [SQL Server on Azure Virtual Machines](https://localhost:3000/catalogue/components/azure-sql-server-vm.md) `azure-sql-server-vm` — 4 defaults

### cloudflare

- [Cloudflare D1](https://localhost:3000/catalogue/components/cloudflare-d1.md) `cloudflare-d1` — 7 defaults

### default

- [Citus](https://localhost:3000/catalogue/components/citus.md) `citus` — 5 defaults
- [CockroachDB](https://localhost:3000/catalogue/components/cockroachdb.md) `cockroachdb` — 6 defaults
- [CockroachDB Cloud](https://localhost:3000/catalogue/components/cockroachdb-cloud.md) `cockroachdb-cloud` — 9 defaults
- [Datomic](https://localhost:3000/catalogue/components/datomic.md) `datomic` — 5 defaults
- [IBM Db2](https://localhost:3000/catalogue/components/db2.md) `db2` — 2 defaults
- [EDB Postgres Advanced Server](https://localhost:3000/catalogue/components/edb-postgres.md) `edb-postgres` — 4 defaults
- [Claris FileMaker Server](https://localhost:3000/catalogue/components/filemaker.md) `filemaker` — 3 defaults
- [Firebird](https://localhost:3000/catalogue/components/firebird.md) `firebird` — 2 defaults
- [IBM Informix](https://localhost:3000/catalogue/components/informix.md) `informix` — 2 defaults
- [Actian Ingres](https://localhost:3000/catalogue/components/ingres.md) `ingres` — 3 defaults
- [InterBase](https://localhost:3000/catalogue/components/interbase.md) `interbase` — 5 defaults
- [InterSystems IRIS](https://localhost:3000/catalogue/components/intersystems-iris.md) `intersystems-iris` — 4 defaults
- [MariaDB Server](https://localhost:3000/catalogue/components/mariadb.md) `mariadb` — 2 defaults
- [MySQL](https://localhost:3000/catalogue/components/mysql.md) `mysql` — 2 defaults
- [Neon](https://localhost:3000/catalogue/components/neon.md) `neon` — 2 defaults
- [OceanBase Database](https://localhost:3000/catalogue/components/oceanbase.md) `oceanbase` — 6 defaults
- [Progress OpenEdge](https://localhost:3000/catalogue/components/openedge.md) `openedge` — 4 defaults
- [Oracle Database](https://localhost:3000/catalogue/components/oracle-db.md) `oracle-db` — 2 defaults
- [PlanetScale](https://localhost:3000/catalogue/components/planetscale.md) `planetscale` — 2 defaults
- [PostGIS](https://localhost:3000/catalogue/components/postgis.md) `postgis` — 1 defaults
- [PostgreSQL](https://localhost:3000/catalogue/components/postgres.md) `postgres` — 2 defaults
- [Relational database](https://localhost:3000/catalogue/components/relational-database.md) `relational-database` — 1 defaults
- [SAP Adaptive Server Enterprise](https://localhost:3000/catalogue/components/sap-ase.md) `sap-ase` — 2 defaults
- [SAP HANA](https://localhost:3000/catalogue/components/sap-hana.md) `sap-hana` — 1 defaults
- [SingleStore](https://localhost:3000/catalogue/components/singlestore.md) `singlestore` — 3 defaults
- [SAP SQL Anywhere](https://localhost:3000/catalogue/components/sql-anywhere.md) `sql-anywhere` — 4 defaults
- [Microsoft SQL Server](https://localhost:3000/catalogue/components/sql-server.md) `sql-server` — 2 defaults
- [SQLite](https://localhost:3000/catalogue/components/sqlite.md) `sqlite` — 4 defaults
- [Supabase](https://localhost:3000/catalogue/components/supabase.md) `supabase` — 2 defaults
- [TiDB](https://localhost:3000/catalogue/components/tidb.md) `tidb` — 7 defaults
- [Turso](https://localhost:3000/catalogue/components/turso.md) `turso` — 2 defaults
- [Xata](https://localhost:3000/catalogue/components/xata.md) `xata` — 1 defaults
- [YugabyteDB](https://localhost:3000/catalogue/components/yugabytedb.md) `yugabytedb` — 7 defaults

### digitalocean

- [DigitalOcean Managed Databases](https://localhost:3000/catalogue/components/digitalocean-managed-databases.md) `digitalocean-managed-databases` — 5 defaults

### gcp

- [AlloyDB for PostgreSQL](https://localhost:3000/catalogue/components/google-alloydb.md) `google-alloydb` — 5 defaults
- [Cloud SQL](https://localhost:3000/catalogue/components/google-cloud-sql.md) `google-cloud-sql` — 4 defaults
- [Oracle Database@Google Cloud](https://localhost:3000/catalogue/components/google-oracle-database.md) `google-oracle-database` — 3 defaults
- [Google Cloud Spanner](https://localhost:3000/catalogue/components/spanner.md) `spanner` — 8 defaults

### ibm

- [IBM Cloud Databases for MySQL](https://localhost:3000/catalogue/components/ibm-databases-for-mysql.md) `ibm-databases-for-mysql` — 4 defaults
- [IBM Cloud Databases for PostgreSQL](https://localhost:3000/catalogue/components/ibm-databases-for-postgresql.md) `ibm-databases-for-postgresql` — 4 defaults
- [IBM Db2 SaaS](https://localhost:3000/catalogue/components/ibm-db2.md) `ibm-db2` — 1 defaults

### oci

- [OCI Autonomous Database](https://localhost:3000/catalogue/components/oci-autonomous-database.md) `oci-autonomous-database` — 6 defaults
- [Autonomous AI Database on Exadata Cloud@Customer](https://localhost:3000/catalogue/components/oci-autonomous-database-cloud-at-customer.md) `oci-autonomous-database-cloud-at-customer` — 6 defaults
- [Autonomous AI Database on Dedicated Exadata Infrastructure](https://localhost:3000/catalogue/components/oci-autonomous-database-dedicated.md) `oci-autonomous-database-dedicated` — 6 defaults
- [Oracle Base Database Service](https://localhost:3000/catalogue/components/oci-base-database.md) `oci-base-database` — 6 defaults
- [Oracle Base Database Cloud@Customer](https://localhost:3000/catalogue/components/oci-base-database-cloud-at-customer.md) `oci-base-database-cloud-at-customer` — 4 defaults
- [Oracle AI Database@AWS](https://localhost:3000/catalogue/components/oci-database-at-aws.md) `oci-database-at-aws` — 6 defaults
- [Oracle AI Database@Azure](https://localhost:3000/catalogue/components/oci-database-at-azure.md) `oci-database-at-azure` — 6 defaults
- [Oracle AI Database@Google Cloud](https://localhost:3000/catalogue/components/oci-database-at-google-cloud.md) `oci-database-at-google-cloud` — 6 defaults
- [Exadata Database Service on Cloud@Customer](https://localhost:3000/catalogue/components/oci-exadata-database-cloud-at-customer.md) `oci-exadata-database-cloud-at-customer` — 5 defaults
- [Exadata Database Service on Dedicated Infrastructure](https://localhost:3000/catalogue/components/oci-exadata-database-dedicated.md) `oci-exadata-database-dedicated` — 5 defaults
- [Exadata Database Service on Exascale Infrastructure](https://localhost:3000/catalogue/components/oci-exadata-database-exascale.md) `oci-exadata-database-exascale` — 5 defaults
- [Globally Distributed Autonomous AI Database](https://localhost:3000/catalogue/components/oci-globally-distributed-autonomous-database.md) `oci-globally-distributed-autonomous-database` — 9 defaults
- [Globally Distributed Exadata Database on Exascale Infrastructure](https://localhost:3000/catalogue/components/oci-globally-distributed-exadata-exascale.md) `oci-globally-distributed-exadata-exascale` — 7 defaults
- [MySQL HeatWave DB system](https://localhost:3000/catalogue/components/oci-mysql-heatwave.md) `oci-mysql-heatwave` — 6 defaults
- [OCI Database with PostgreSQL](https://localhost:3000/catalogue/components/oci-postgresql.md) `oci-postgresql` — 4 defaults
- [TimesTen Database for OKE](https://localhost:3000/catalogue/components/oci-timesten.md) `oci-timesten` — 2 defaults

### openstack

- [OpenStack Trove](https://localhost:3000/catalogue/components/openstack-trove.md) `openstack-trove` — 3 defaults

## Source (`kind` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/kind.schema.json
# Relational datastore, usually the system of record.
# multiWriter and sharded default false so single-writer-primary-at-peak-qps can fire on the common case.
schemaVersion: "1"
type: "kind"
id: "sql-database"
category: "data"
properties:
  backupEnabled:
    type: "boolean"
    default: false
  backupRetentionDays:
    type: "integer"
  replication:
    type: "enum"
    values: ["none", "async", "sync"]
    default: "none"
  replicaOf:
    type: "ref"
    refKind: "sql-database"
  encryptionAtRest:
    type: "boolean"
    default: false
  sharded:
    type: "boolean"
    default: false
  shardKey:
    type: "string"
  multiWriter:
    type: "boolean"
    default: false
  distributed:
    type: "boolean"
    default: false
  replicaFanout:
    type: "integer"
    advanced: true
  idEncodesShard:
    type: "boolean"
    default: false
    advanced: true
  concurrencyControl:
    type: "enum"
    values: ["pessimistic", "optimistic", "constraint"]
    advanced: true
  commitProtocol:
    type: "enum"
    values: ["single", "two-phase"]
    default: "single"
    advanced: true
  appendOnly:
    type: "boolean"
    default: false
    advanced: true
  instances:
    type: "integer"
  managed:
    type: "boolean"
    default: false
```

Human page: https://localhost:3000/catalogue/kinds/sql-database
