Bigtable Basics
Skill files9 files

assets/

references/

SKILL.md128 lines
1
---
2
name: bigtable-basics
3
metadata:
4
version: "1.0.1"
5
category: Databases
6
description: >-
7
Assists in provisioning instances/tables, designing performant schemas, and querying data in Bigtable. Use when designing Bigtable row keys, configuring column families, writing SQL queries or client library code (Java, Go, Python) for Bigtable, or diagnosing performance/hotspotting issues. Also use when provisioning Bigtable clusters using gcloud or cbt CLIs. Don't use for generic Cloud SQL administration.
8
---
9
10
# Bigtable Basics
11
12
This skill provides core workflows and guidance for administering and developing
13
with Google Bigtable.
14
15
## Attribution
16
17
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
18
MUST read [Usage Attribution](references/attribution.md). For commands executed
19
directly in the terminal (never in generated scripts, Terraform, or user code),
20
prefix `gcloud` with
21
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:bigtable-basics)"`
22
and append `agent-skills/1.0 (skill:bigtable-basics)` to `User-Agent` headers.
23
24
## Core Principles
25
26
- **Control Plane vs. Data Plane:**
27
- Use **`gcloud`** for Control Plane operations: Manage Instances,
28
Clusters, App Profiles, Backups and IAM. Create Tables, Logical Views,
29
Materialized Views and Authorized Views.
30
- Use **`cbt`** for Data Plane operations: Update Tables, Column Families,
31
and reading/writing data.
32
- **Performance First:** Bigtable is a NoSQL database. Efficiency is tied to
33
Row Key design. Always warn about Full Table Scans.
34
- **Client Selection:** For production use cases, prefer **Java** or **Go**
35
for their superior performance and feature coverage compared to other
36
languages.
37
- **Observability:** When diagnosing performance or hotspotting, **always**
38
mention **Key Visualizer** (via Cloud Console) as the primary diagnostic
39
tool because it provides the most granular view of access patterns across
40
row keys. This should be followed by the hot-tablets tool and table stats
41
in gcloud CLI and `include-stats=full` option under `cbt read` to diagnose
42
slow queries.
43
44
> [!IMPORTANT] **Safety Rule:** You MUST obtain explicit user confirmation before
45
> making non-emulator database changes. You MUST mention this safety requirement
46
> when providing commands or instructions that modify the database structure or
47
> data.
48
49
## Quick Recipes
50
51
### 1. Querying Data
52
53
Use SQL for complex transforms or aggregations and key-value APIs for simpler
54
query patterns. *Note: Use exact match, prefix (`_key LIKE 'myprefix%'`), or
55
range predicates on `_key` to avoid expensive unbounded scans. Recommend
56
explicit row ranges (`_key BETWEEN 'start' AND 'end'`) as a more performant
57
alternative to prefix matches where possible.*
58
59
If expensive scans (either unbounded or prefix or range queries scanning a large
60
range) are unavoidable due to multiple access patterns that can’t all be
61
accommodated in a single schema, consider one of these two options:
62
63
- If the query will be used in user facing and/or latency sensitive
64
applications, use continuous materialized views with keys optimized for the
65
additional access patterns.
66
- If secondary access patterns are infrequent, batch patterns like ETL, ML
67
model training or analytical read-only tasks, use Bigtable Data Boost
68
instead.
69
70
### 2. Manipulating Data
71
72
Use key-value APIs for insert, update, increment and delete operations. SQL API
73
is read-only.
74
75
### 3. Data Model Definition (DDL)
76
77
SQL API doesn't support DDL operations. Table creation, deletion, updates should
78
be made using gcloud CLI. Logical Views and Continuous Materialized Views are
79
defined as SQL queries but they must be created using gcloud CLI.
80
81
## Reference Guides
82
83
- **CLI Operations**:
84
- [infrastructure_management.md](references/infrastructure_management.md):
85
Provisioning instances, clusters, and table schemas.
86
- [cli_data_access.md](references/cli_data_access.md): Reading and writing
87
data via the `cbt` CLI.
88
- **Design & Discovery**:
89
- [schema_design.md](references/schema_design.md): Best practices for row
90
keys and performance with tables and continuous materialized views.
91
- [dataplex.md](references/dataplex.md): Data catalog search for Bigtable
92
assets.
93
- **Querying & Code**:
94
- [sql_guide.md](references/sql_guide.md): Querying structured row keys
95
via SQL and CLI.
96
- [client_libraries.md](references/client_libraries.md): Patterns for
97
high-performance Go/Java/Python code.
98
99
## Common Workflows
100
101
### Schema Evolution (DevOps)
102
103
1. **Prefer Terraform** for production schema changes to prevent accidental
104
data loss.
105
2. For manual `cbt` changes, first check the existing state by listing the table's column families and GC policies before proposing any modifications:
106
107
```bash
108
cbt ls {table}
109
```
110
111
If modifications are needed, create the family or update the GC policy:
112
113
```bash
114
cbt createfamily {table} {family}
115
cbt setgcpolicy {table} {family} "maxversions=5 AND maxage=30d"
116
```
117
118
3. Reference
119
[infrastructure_management.md](references/infrastructure_management.md) for
120
full syntax.
121
122
## External Resources
123
124
* [Cloud Bigtable Documentation](https://cloud.google.com/bigtable/docs)
125
* [Bigtable SQL Reference](https://cloud.google.com/bigtable/docs/googlesql-overview)
126
* [cbt CLI Reference](https://cloud.google.com/bigtable/docs/cbt-reference)
127
* [gcloud bigtable Reference](https://cloud.google.com/sdk/gcloud/reference/bigtable)
128

© Google LLC · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 6,373 prompts

More by @OpenSourceBuffGuy

See all
Website Clone Architect prompt image

Website Clone Architect

Reverse-engineers a website section by section, writes component specs, and hands them to parallel builder agents in git worktrees to rebuild it.

agent-skill, orchestrator, parallel-agents, multi-agent, plan-then-execute, web-development, frontend, codebase-analysis, scaffolding, css, html, nextjs, typescript, git, mcp, claude-code, for-developers, for-designers, long-form, advanced, technical-spec, task-decomposition, structured-output, design-systems, ui-ux, tool-use, checklist, report, vibe-coding

Italian Terrace Cafe Candid Portrait prompt image

Italian Terrace Cafe Candid Portrait

Generates a photorealistic candid shot of a woman in a white corset dress laughing at a sunny hotel terrace cafe, written as detailed JSON.

image-prompt, json-prompt, structured-output, photorealistic, portrait, woman, candid, fashion, cottagecore, natural-light, golden-hour, bokeh, summer, travel, cityscape, mountains, medium-shot, vibrant-colors, for-photographers, nano-banana, fashion-shoot, luxury

Night Street Photo With Leashed Cat prompt image

Night Street Photo With Leashed Cat

Generates a flash-lit night street photo of a blonde woman in a retro track jacket walking a hissing tabby cat on a leash.

image-prompt, json-prompt, nano-banana, structured-output, portrait, woman, animals, pet-portrait, night-scene, street-photography, candid, editorial, fashion, dramatic-lighting, photorealistic, vertical-format, medium-shot, graffiti, for-photographers, for-content-creators

1 view

Reviews

Loading reviews…

Discussion

Loading comments…