본문으로 건너뛰기
Skillpedia
데이터베이스22k · #10351

spanner-basics

하는 일

이 스킬은 전 세계적으로 일관성을 보장하는 Google 데이터베이스인 Cloud Spanner를 사용하도록 돕습니다. 여러 리전에 걸쳐 강한 일관성과 확장성이 필요한 팀을 위한 스킬입니다.

사용하는 경우

  • ✓Cloud Spanner 인스턴스나 데이터베이스를 프로비저닝하고 싶을 때.
  • ✓핫스팟을 피하는 기본 키나 스키마를 설계해야 할 때.
  • ✓Spanner 쿼리나 클라이언트 코드가 느려서 원인을 진단해야 할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google/skills/blob/main/skills/cloud/spanner-basics/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“주문 앱을 위한 Cloud Spanner 스키마를 설계하고, 핫스팟을 만들 수 있는 기본 키가 있으면 경고해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

인스턴스와 데이터베이스를 설정하는 방법을 설명하고, 순차적으로 증가하는 기본 키처럼 핫스팟을 만들 수 있는 키를 경고합니다. 에뮬레이터가 아닌 데이터베이스를 바꾸기 전에는 승인을 요청합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.

자주 묻는 질문

실서비스 데이터베이스를 확인 없이 바꾸나요?

아닙니다. DML이나 DDL 변경, 파괴적인 작업 전에는 명시적인 확인이 필요합니다.

Spanner에서 핫스팟이란 무엇인가요?

많은 쓰기가 키 범위의 같은 부분에 몰리는 현상으로, 흔히 순차적인 기본 키 때문에 생깁니다.

부모-자식 테이블 구조를 지원하나요?

네. 강하게 연관되어 함께 자주 읽는 데이터에는 인터리브 테이블을 제안합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
22k
순위
#10351
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬