Skip to content

GCP.Bigtable reference

Source: src/GCP/Bigtable/AppProfile.ts

A Cloud Bigtable app profile — how client traffic is routed across clusters in an instance.

The parent instance must already exist. Every instance has a built-in default profile; this resource creates additional profiles. Changing appProfileId or instance replaces the profile. Description, routing, and isolation update in place.

App profiles have no labels field. Alchemy treats a profile as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it. The built-in default profile is never listed.

Multi-cluster routing

const instance = yield* GCP.Bigtable.Instance("Data", {});
const profile = yield* GCP.Bigtable.AppProfile("Analytics", {
instance: instance.name,
description: "analytics reads",
multiClusterRouting: {},
});

Single-cluster routing

const profile = yield* GCP.Bigtable.AppProfile("Writes", {
instance: instance.name,
singleClusterRouting: {
clusterId: "cluster",
allowTransactionalWrites: true,
},
});

Source: src/GCP/Bigtable/Cluster.ts

A Cloud Bigtable cluster — a resizable group of nodes in one zone that serves every table in the parent instance.

An instance always has at least one cluster (created with the instance). Use this resource to add additional clusters or to manage an existing cluster’s node count and autoscaling. You cannot delete the last cluster in an instance.

Changing clusterId, instance, location, defaultStorageType, nodeScalingFactor, or encryptionConfig.kmsKeyName replaces the cluster. serveNodes and clusterConfig.clusterAutoscalingConfig update in place.

Clusters have no labels field. list enumerates clusters on alchemy-labeled instances so pnpm nuke:gcp can find leaked rows.

Provisioning typically takes several minutes.

Additional cluster on an existing instance

const replica = yield* GCP.Bigtable.Cluster("Replica", {
instance: instance.instanceId,
location: "us-central1-b",
serveNodes: 1,
});

Explicit id and HDD storage

const replica = yield* GCP.Bigtable.Cluster("Replica", {
instance: "app-instance",
clusterId: "app-replica",
location: "us-central1-c",
defaultStorageType: "HDD",
serveNodes: 1,
});
const replica = yield* GCP.Bigtable.Cluster("Replica", {
instance: "app-instance",
location: "us-central1-f",
clusterConfig: {
clusterAutoscalingConfig: {
autoscalingLimits: { minServeNodes: 1, maxServeNodes: 3 },
autoscalingTargets: { cpuUtilizationPercent: 50 },
},
},
});

Source: src/GCP/Bigtable/GetCluster.ts

Runtime binding for Cloud Bigtable clusters.get.

Bind this operation to a Cluster in a Function/Action init phase. Provide GetClusterHttp.

const getCluster = yield* GCP.Bigtable.GetCluster(replica);
const live = yield* getCluster();

Source: src/GCP/Bigtable/GetClusterHttp.ts Kind: Layer · Provides: GCP.Bigtable.GetCluster

HTTP implementation of GetCluster.

Source: src/GCP/Bigtable/GetInstance.ts

Runtime binding for Cloud Bigtable instances.get.

Bind this operation to an Instance in a Function/Action init phase. Provide GetInstanceHttp.

const getInstance = yield* GCP.Bigtable.GetInstance(store);
const live = yield* getInstance();

Source: src/GCP/Bigtable/GetInstanceHttp.ts Kind: Layer · Provides: GCP.Bigtable.GetInstance

HTTP implementation of GetInstance.

Source: src/GCP/Bigtable/GetTable.ts

Runtime binding for Bigtable Admin tables.get.

Bind this operation to a Table in a Function/Action init phase. Provide GetTableHttp.

const getTable = yield* GCP.Bigtable.GetTable(users);
const live = yield* getTable({ view: "SCHEMA_VIEW" });

Source: src/GCP/Bigtable/GetTableHttp.ts Kind: Layer · Provides: GCP.Bigtable.GetTable

HTTP implementation of GetTable.

Source: src/GCP/Bigtable/Instance.ts

A Cloud Bigtable instance — a container for clusters, tables, and app profiles.

Create requires at least one cluster. The default is a single 1-node HDD cluster in us-central1-b. Changing instanceId replaces the instance. displayName, type, edition, and labels update in place. Cluster create-time fields (location, storage type, CMEK) are immutable; manage clusters after create with GCP.Bigtable.Cluster.

Provisioning typically takes one to two minutes.

Generated name, 1-node HDD cluster

const instance = yield* GCP.Bigtable.Instance("Data", {});

Explicit id, labels, and cluster

const instance = yield* GCP.Bigtable.Instance("Data", {
instanceId: "app-bt",
displayName: "app bigtable",
type: "PRODUCTION",
labels: { env: "prod" },
clusters: {
cluster: {
location: "us-central1-b",
serveNodes: 1,
defaultStorageType: "HDD",
},
},
});
const getInstance = yield* GCP.Bigtable.GetInstance(instance);
const live = yield* getInstance();

Source: src/GCP/Bigtable/InstancesClustersBackup.ts

A Cloud Bigtable backup of a table, stored on one cluster.

The parent instance, cluster, and source table must already exist. Changing backupId, instance, cluster, sourceTable, or backupType replaces the backup. expireTime and hotToStandardTime update in place.

Backups have no labels field. Alchemy treats a backup as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesClustersBackup: Creating a Backup

Section titled “InstancesClustersBackup: Creating a Backup”

7-day backup of an existing table

const backup = yield* GCP.Bigtable.InstancesClustersBackup("Nightly", {
instance: instance.name,
cluster: "cluster",
sourceTable: table.name,
});

Explicit id and expiration

const backup = yield* GCP.Bigtable.InstancesClustersBackup("Nightly", {
instance: instance.name,
cluster: replica.clusterId,
sourceTable: table.name,
backupId: "nightly",
expireTime: "2026-12-31T00:00:00Z",
backupType: "STANDARD",
});

Source: src/GCP/Bigtable/InstancesLogicalView.ts

A Cloud Bigtable logical view — a SQL SELECT over a table that can be queried as a virtual table.

The parent instance must already exist and the query cannot use SELECT *. Changing logicalViewId or instance replaces the view. query and deletionProtection update in place.

Logical views have no labels field. Alchemy treats a view as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesLogicalView: Creating a Logical View

Section titled “InstancesLogicalView: Creating a Logical View”
const users = yield* GCP.Bigtable.Table("Users", {
instance: instance.name,
columnFamilies: { cf: {} },
});
const view = yield* GCP.Bigtable.InstancesLogicalView("Active", {
instance: instance.name,
query: "SELECT _key FROM users",
});

Source: src/GCP/Bigtable/InstancesMaterializedView.ts

A Cloud Bigtable continuous materialized view — a SQL SELECT whose results are precomputed and kept current.

The parent instance must already exist. The query must use GROUP BY or ORDER BY and cannot use SELECT *. Changing materializedViewId, instance, or query replaces the view. deletionProtection updates in place.

Materialized views have no labels field. Alchemy treats a view as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesMaterializedView: Creating a Materialized View

Section titled “InstancesMaterializedView: Creating a Materialized View”
const events = yield* GCP.Bigtable.Table("Events", {
instance: instance.name,
columnFamilies: { cf: {} },
});
const view = yield* GCP.Bigtable.InstancesMaterializedView("Counts", {
instance: instance.name,
query: "SELECT '*' AS _key, COUNT(*) AS row_count FROM events GROUP BY _key",
});

Source: src/GCP/Bigtable/InstancesTablesAuthorizedView.ts

A Cloud Bigtable authorized view — a named subset of a table used for fine-grained IAM.

The parent instance and table must already exist. Changing authorizedViewId, instance, or table replaces the view. subsetView and deletionProtection update in place.

Authorized views have no labels field. Alchemy treats a view as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesTablesAuthorizedView: Creating an Authorized View

Section titled “InstancesTablesAuthorizedView: Creating an Authorized View”
const view = yield* GCP.Bigtable.InstancesTablesAuthorizedView("Public", {
instance: instance.name,
table: table.name,
subsetView: {
rowPrefixes: [""],
familySubsets: {
cf: { qualifierPrefixes: [""] },
},
},
});

Source: src/GCP/Bigtable/InstancesTablesSchemaBundle.ts

A Cloud Bigtable schema bundle — a named FileDescriptorSet used to decode protobuf cell values.

The parent instance and table must already exist. Changing schemaBundleId, instance, or table replaces the bundle. protoDescriptors update in place (must be backwards compatible unless ignoreWarnings is true).

Schema bundles have no labels field. Alchemy treats a bundle as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

InstancesTablesSchemaBundle: Creating a Schema Bundle

Section titled “InstancesTablesSchemaBundle: Creating a Schema Bundle”
const bundle = yield* GCP.Bigtable.InstancesTablesSchemaBundle("Rows", {
instance: instance.name,
table: table.name,
protoDescriptors: descriptors,
});

Source: src/GCP/Bigtable/Table.ts

A Cloud Bigtable table — rows keyed by row key, grouped into column families.

The parent instance must already exist. Changing tableId, instance, or granularity replaces the table. Column families, deletion protection, change streams, and automated backups update in place. Row read/write is a data-plane API; use GetTable for admin metadata.

Tables have no labels field. Alchemy treats a table as owned when its parent instance carries Alchemy labels, so list / pnpm nuke:gcp can find it.

const instance = yield* GCP.Bigtable.Instance("Data", {});
const table = yield* GCP.Bigtable.Table("Users", {
instance: instance.name,
columnFamilies: {
cf: { gcRule: { maxNumVersions: 3 } },
},
});
const getTable = yield* GCP.Bigtable.GetTable(table);
const live = yield* getTable({ view: "SCHEMA_VIEW" });