Skip to main content

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.

PropertyTypeDescription
apiVersionstringAPI schema version. Pins the manifest to a specific schema contract for backward-compatibility. Must be the constant lowops.manifests.v1.
kindstringResource 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.
metadatamapClassification 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.
specSpecDesired 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.

PropertyTypeDescription
descriptionstringHuman-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.
databaseslist of DatabaseDefinitionLogical 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).
alloydbAlloyDBConfigAlloyDB (PostgreSQL) engine configuration. See AlloyDBConfig. Selects AlloyDB as the backing engine.
spannerSpannerConfigCloud 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.

PropertyTypeDescription
cpuCountint64vCPUs 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.
clusterSizeint64Total 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.
configurationConfigurationAdvanced PostgreSQL tuning. See Configuration. Reserved for database-flag tuning; NOT YET IMPLEMENTED — currently not read by the executor.
backupConfigBackupConfigAutomated 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.

PropertyTypeDescription
enabledboolEnable 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.
timeBasedRetentionSecint64Backup 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.
quantityBasedRetentionint64Backup 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.
windowDurationstringBackup 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.
daysOfWeeklist of stringDays 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.
hoursint64Backup 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.
minutesint64Backup 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.

PropertyTypeDescription
maxConnectionsint64Maximum 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.
autoExplainboolEnable 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.
googleColumnarEngineboolEnable 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.
googleDbAdvisorboolEnable 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.

PropertyTypeDescription
namestringDatabase 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.
extensionslist of stringPostgreSQL 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.

PropertyTypeDescription
processingUnitsint64Fixed 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.
autoscalingboolEnable managed autoscaling. When true, Spanner manages capacity automatically and any explicit processing_units is ignored. Mutually exclusive with fixed capacity below 1000 PU.
regionstringGCP 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}.
editionstringSpanner 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.