Skip to content
cloudemu
Services

Bigtable

In-memory control plane for Cloud Bigtable — instances, clusters, tables, app profiles, and backups, driven with the real bigtableadmin SDK

gcp Bigtable

Emulates the control plane of Cloud Bigtable, GCP's wide-column NoSQL database — the admin API that provisions instances and clusters, creates tables with column families, and manages app profiles and backups. The data plane (reading and writing rows) is out of scope, so it has its own driver. An instance owns clusters and tables; backups live under a cluster and restore into a new table.

Reach for it in tests when your provisioning code creates a Bigtable instance, adds clusters, defines tables and column families, or backs up and restores a table — without a real (billed) instance. Served as GCP REST/JSON under /v2/..., so a real google.golang.org/api/bigtableadmin/v2 client with a custom endpoint works unchanged; the wire layer uses the SDK's own types for exact fidelity.

ProviderServiceSDK-compatDriver
GCPCloud Bigtable✓ Livegcp.Bigtable

Drive it with the real SDK#

Stand up the GCP SDK-compat server and point a bigtableadmin service at it. Long-running RPCs return a done Operation carrying the resulting resource, so SDK LRO waits complete immediately:

import (
    "google.golang.org/api/bigtableadmin/v2"
    "google.golang.org/api/option"
    "github.com/stackshy/cloudemu/v2"
    gcpserver "github.com/stackshy/cloudemu/v2/server/gcp"
)

cloud := cloudemu.NewGCP()
ts := httptest.NewServer(gcpserver.New(gcpserver.Drivers{Bigtable: cloud.Bigtable}))
defer ts.Close()

svc, _ := bigtableadmin.NewService(ctx,
    option.WithEndpoint(ts.URL), option.WithoutAuthentication())

svc.Projects.Instances.Create("projects/my-project", &bigtableadmin.CreateInstanceRequest{
    InstanceId: "app",
    Instance:   &bigtableadmin.Instance{DisplayName: "App", Type: "PRODUCTION"},
    Clusters: map[string]bigtableadmin.Cluster{
        "c1": {Location: "projects/my-project/locations/us-central1-a",
            ServeNodes: 3, DefaultStorageType: "SSD"},
    },
}).Do()

See the SDK-Compat Server page for the full quick start.

Call the driver directly#

For in-process setup or assertions you can skip the HTTP hop and call the driver. CreateInstance and other long-running calls return the resource plus an *Operation:

import btdriver "github.com/stackshy/cloudemu/v2/services/bigtable/driver"

inst, _, _ := gcp.Bigtable.CreateInstance(ctx, btdriver.CreateInstanceConfig{
    Name: "projects/my-project/instances/app", DisplayName: "App", Type: "PRODUCTION",
    Clusters: []btdriver.CreateClusterConfig{{
        Name:     "projects/my-project/instances/app/clusters/c1",
        Location: "projects/my-project/locations/us-central1-a",
        ServeNodes: 3, DefaultStorageType: "SSD",
    }},
})

gcp.Bigtable.CreateTable(ctx, btdriver.CreateTableConfig{
    Parent:  "projects/my-project/instances/app",
    TableID: "events",
})

Behavior & fidelity#

BehaviorWhat happens
Instances own childrenAn instance owns its clusters, tables, and app profiles; deleting it cascade-deletes them.
ClustersFull CRUD with serve-node scaling and autoscaling.
TablesCRUD, column families with GC rules, and soft-delete with restore.
App profilesRouting-policy CRUD.
BackupsCRUD, copy, and restore into a new table.
Consistency helpersRow-range drops and consistency tokens support data-consistency workflows.
Operations and IAMLROs are pollable, and instances, tables, and backups each carry an IAM policy.
LRO fidelityLong-running RPCs return a done Operation, so SDK waits complete; clone-on-read isolates stored state.

SDK-compat — Live#

Real bigtableadmin/v2 clients drive it end-to-end (GCP REST/JSON under /v2/...) — see SDK-Compat for the full operation list.

On this page

On this page