Database
Database
Declares a managed database instance and the logical databases to provision on it.
A single Database manifest targets one engine — AlloyDB (PostgreSQL) or Cloud Spanner — selected via the oneof engine. Shared fields such as description and databases live at the top of Spec so applications reference the same logical databases by name regardless of the backing engine. The engine defaults, validates, computes inherited state (region, hibernation) from the parent Project, and provisions the cluster/instance plus its databases, roles, and access grants.
| Property | Type | Description |
|---|---|---|
| apiVersion | string | API schema version. Pins the manifest to a specific schema contract for backward-compatibility. Must be the constant lowops.manifests.v1. |
| kind | string | Resource kind discriminator. Identifies this document as a Database so the engine routes it to the correct defaulter, validator, computer, and executor. Must be the constant Database. |
| metadata | map | Classification labels and graph linkage. Free-form key/value pairs used to classify the manifest. Certain reserved keys (e.g. name, project) are read by the engine to resolve this manifest's identity and its parent Project in the dependency graph. |
| spec | Spec | Desired database configuration. The authoritative, user-authored specification for this database. See Spec. |
Spec
User-authored database configuration.
Selects the database engine (AlloyDB or Spanner) and its sizing/tuning, and declares the logical databases to create on the instance. Instructs the engine on capacity, protection policies, and which schemas applications may reference.
| Property | Type | Description |
|---|---|---|
| description | string | Human-readable description of the database. Optional free text describing this database's purpose. Propagated onto provisioned auxiliary resources (e.g. the AlloyDB proxy subnet and service connection policy descriptions) and used as context by AI assistants when reasoning about the manifest. |
| databases | list of DatabaseDefinition | Logical databases to provision on this instance. See DatabaseDefinition. Each entry is created on the instance and exposed to applications by name via their accessControl.database.schema field. The computer copies these into computed.databases (deduplicated, extensions merged). |
| alloydb | AlloyDBConfig | AlloyDB (PostgreSQL) engine configuration. See AlloyDBConfig. Selects AlloyDB as the backing engine. |
| spanner | SpannerConfig | Cloud Spanner engine configuration. See SpannerConfig. Selects Cloud Spanner as the backing engine. |
AlloyDBConfig
AlloyDB (PostgreSQL) engine configuration.
Provisions an AlloyDB cluster with Private Service Connect connectivity and a proxy subnet, a primary and optional read-pool instances, and PostgreSQL-level databases, roles, and grants.
| Property | Type | Description |
|---|---|---|
| cpuCount | int64 | vCPUs per instance. Number of vCPUs allocated to each primary and read-pool instance; drives the machine sizing of the cluster. The validator requires a value of at least 1. |
| clusterSize | int64 | Total instances in the cluster. Cluster size: 1 means a single primary with no read replicas; values above 1 add that many read-pool instances and set the Private Service Connect producer limit. Must be at least 1. |
| configuration | Configuration | Advanced PostgreSQL tuning. See Configuration. Reserved for database-flag tuning; NOT YET IMPLEMENTED — currently not read by the executor. |
| backupConfig | BackupConfig | Automated backup policy. See BackupConfig. Validated and normalized by the engine, but not yet provisioned by the executor. |
BackupConfig
Automated backup policy for the AlloyDB cluster.
PARTIALLY IMPLEMENTED. These fields are validated by the engine (retention strategy and window ranges) and days_of_week is defaulted by the computer, but the AlloyDB executor does not yet provision an automated backup policy from them. Intended behavior: enforce snapshot schedules and retention rules on the cluster.
| Property | Type | Description |
|---|---|---|
| enabled | bool | Enable automated backups. When true, the validator requires exactly one retention strategy (time_based_retention_sec or quantity_based_retention) and range-checks the window. NOTE: the executor does not yet provision the backup policy, so this currently only gates validation. |
| timeBasedRetentionSec | int64 | Backup retention as a duration, in seconds. Number of seconds to retain automated backups. Mutually exclusive with quantity_based_retention; the validator rejects setting both and requires one when enabled is true. |
| quantityBasedRetention | int64 | Backup retention as a count. Number of automated backups to retain. Mutually exclusive with time_based_retention_sec; the validator rejects setting both and requires one when enabled is true. |
| windowDuration | string | Backup window length. NOT YET IMPLEMENTED. No consumer reads this field. Intended future behavior: bound the daily backup window, expressed as a duration string such as 3600s. |
| daysOfWeek | list of string | Days on which backups may run. Weekdays when the backup window is allowed (e.g. MONDAY, WEDNESDAY). Defaulted by the database computer to ["SUNDAY"] when left empty. NOTE: not yet consumed by the executor. |
| hours | int64 | Backup window start hour (UTC). Hour of day (0-23, UTC) at which the backup window starts. Range-checked by the validator when backups are enabled. |
| minutes | int64 | Backup window start minute. Minute of the hour (0-59) at which the backup window starts. Range-checked by the validator when backups are enabled. |
Configuration
Advanced PostgreSQL tuning parameters.
NOT YET IMPLEMENTED. Declared in the schema but currently ignored by the engine (no consumer reads it); the AlloyDB executor does not set database flags. Intended future behavior: translate these into custom database flags on the underlying AlloyDB instances to tune query performance.
| Property | Type | Description |
|---|---|---|
| maxConnections | int64 | Maximum concurrent client connections. NOT YET IMPLEMENTED. No consumer reads this field. Intended future behavior: set the PostgreSQL max_connections flag on the AlloyDB instances. Validated to be at least 1000. |
| autoExplain | bool | Enable the auto_explain module. NOT YET IMPLEMENTED. No consumer reads this field. Intended future behavior: when true, enable the PostgreSQL auto_explain module on AlloyDB to log execution plans for slow queries. |
| googleColumnarEngine | bool | Enable the AlloyDB columnar engine. NOT YET IMPLEMENTED. No consumer reads this field. Intended future behavior: when true, enable the AlloyDB columnar engine to accelerate analytical queries. |
| googleDbAdvisor | bool | Enable the AlloyDB Index Advisor. NOT YET IMPLEMENTED. No consumer reads this field. Intended future behavior: when true, enable the AlloyDB Index Advisor to recommend indexes that improve query performance. |
DatabaseDefinition
A logical database to provision on the instance.
Declares one database that applications reference by name in their accessControl.database.schema field. For AlloyDB it becomes a PostgreSQL database with read/write group roles; for Spanner it becomes a Spanner database on the instance.
| Property | Type | Description |
|---|---|---|
| name | string | Database name. Identifier for the logical database (e.g. team_1, infrastream-cloud). Required. For Spanner, the validator enforces 2-30 characters, lowercase letters/digits/-/_, starting with a letter. |
| extensions | list of string | PostgreSQL extensions to enable. Extensions created on the database (e.g. uuid-ossp, pgcrypto). AlloyDB only; the validator rejects extensions declared on Spanner databases. |
SpannerConfig
Cloud Spanner engine configuration.
Provisions a regional Spanner instance with either fixed compute capacity or managed autoscaling and IAM-based access control. Spanner uses Google's distributed SQL engine and needs no VPC or proxy infrastructure.
| Property | Type | Description |
|---|---|---|
| processingUnits | int64 | Fixed compute capacity, in processing units. Explicit capacity for the instance (100-9999, multiples of 100). Mutually exclusive with autoscaling; when neither is set the executor defaults to 100 PU. The validator enforces the >= 100 and multiple-of-100 rules. |
| autoscaling | bool | Enable managed autoscaling. When true, Spanner manages capacity automatically and any explicit processing_units is ignored. Mutually exclusive with fixed capacity below 1000 PU. |
| region | string | GCP region for the instance. Region such as us-east1; when omitted the executor falls back to the computed region inherited from the parent Project. The Spanner instance config is derived as regional-{region}. |
| edition | string | Spanner edition. One of STANDARD, ENTERPRISE, or ENTERPRISE_PLUS, passed through to the Spanner instance. Defaults to STANDARD when unset; the validator rejects any other value. |