Langsung ke konten
Skillpedia
Database22k · #10351

spanner-basics

Fungsinya

Skill ini membantu Anda menggunakan Cloud Spanner, database global Google yang konsisten. Skill ini ditujukan untuk tim yang membutuhkan database yang dapat berskala lintas region dengan konsistensi yang kuat.

Kapan dipakai

  • ✓Saat Anda ingin menyediakan instance atau database Cloud Spanner.
  • ✓Saat Anda perlu merancang primary key atau skema yang menghindari hotspot.
  • ✓Saat kueri Spanner atau kode klien lambat dan Anda perlu mendiagnosisnya.

Link skill

https://github.com/google/skills/blob/main/skills/cloud/spanner-basics/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/google/skills/blob/main/skills/cloud/spanner-basics/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Rancang skema Cloud Spanner untuk aplikasi pesanan saya dan peringatkan saya tentang primary key apa pun yang dapat menimbulkan hotspot.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill ini menjelaskan cara menyiapkan instance dan database, serta memperingatkan tentang primary key yang bertambah secara berurutan, yang dapat menimbulkan hotspot. Skill ini meminta persetujuan sebelum perubahan database non-emulator apa pun.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Spanner Basics

This skill provides core workflows and guidance for administering and developing with Cloud Spanner on Google Cloud, a fully managed, mission-critical database service offering global transactional consistency and automatic, synchronous replication for high availability.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:spanner-basics)" and append agent-skills/1.0 (skill:spanner-basics) to User-Agent headers.

Core Principles

  • Performance First: Spanner scales horizontally. Efficiency is tied to Primary Key design. Always warn against using monotonically increasing/decreasing values (like sequential timestamps) as the first part of a primary key to avoid hotspots.
  • Schema Design: Prefer interleaved tables for strongly related parent-child data that is frequently accessed together.

Safety

[!CAUTION] CRITICAL INSTRUCTION: You MUST obtain explicit user confirmation before making any non-emulator database changes (DML or DDL) or destructive operations (such as dropping tables, indexes, or any other Spanner resources). Do not execute them automatically; instead, output the command (e.g., gcloud spanner databases ddl update) and ask for explicit user approval. When database access is unavailable or authentication fails, do not block on trying to verify the existence of the instance, database, or table. Assume the provided resources exist and directly generate the DDL commands.

Common Workflows

Schema Evolution & DDL

  1. Use gcloud spanner databases ddl update to apply schema updates (such as CREATE, ALTER, or DROP tables and indexes).
  2. Reference schema-design.md for guidelines on primary key selection and interleaved tables.

Diagnosing Performance Issues

  1. Use SPANNER_SYS tables to identify slow or resource-intensive queries.
  2. For example, query SPANNER_SYS.QUERY_STATS_TOP_HOUR to find queries with the highest CPU usage.

Reference Directory

  • Core Concepts: Explanation of Spanner internals, architecture, and design.
  • CLI Usage: Essential gcloud spanner command-line operations for managing instances and databases.
  • IAM Security: Roles, permissions, and data governance best practices for Spanner.
  • Client Library Usage: Using Google Cloud client libraries for Spanner (Java, Go, Python, Node.js).
  • Terraform Usage: Infrastructure as Code examples for provisioning Spanner instances and databases.
  • MCP Usage: Using the Spanner remote MCP server.
  • PostgreSQL Dialect: Best practices and examples for using the PostgreSQL interface in Spanner.
  • Queues Usage: Cloud Spanner Queues: mental model, design constraints, and links related to transactional message queues.
  • Schema Design: Guidelines on primary key selection and interleaved tables for performance.

If you need product information that's not found in these references, use the search_documents tool of the Developer Knowledge MCP server.

Pertanyaan umum

Apakah akan mengubah database live saya tanpa bertanya?

Tidak. Skill ini memerlukan konfirmasi eksplisit sebelum perubahan DML atau DDL apa pun atau operasi destruktif.

Apa itu hotspot di Spanner?

Pola ketika banyak penulisan menuju bagian yang sama dari rentang key, sering kali disebabkan oleh primary key yang berurutan.

Apakah mendukung tata letak tabel induk-anak?

Ya. Skill ini menyarankan interleaved table untuk data yang sangat berhubungan dan sering dibaca bersama.

Detail

Deskripsi asli dari pembuat

Assists in provisioning instances and databases, designing performant schemas, and querying data in Cloud Spanner on Google Cloud. Use when designing primary keys, writing SQL queries or client library code, or diagnosing performance issues.

repo: google/skills

Popularitas

Bintang GitHub
22k
Peringkat
#10351
Lisensi
Apache-2.0
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa