spanner-basics
ما الذي تفعله
تساعدك هذه المهارة على استخدام Cloud Spanner، قاعدة بيانات Google المتسقة عالميًا. وهي مخصصة للفرق التي تحتاج إلى قاعدة بيانات تتوسع عبر المناطق مع اتساق قوي.
متى تستخدمها
- ✓عندما تريد توفير نسخة أو قاعدة بيانات Cloud Spanner.
- ✓عندما تحتاج إلى تصميم مفتاح أساسي أو مخطط يتجنب النقاط الساخنة.
- ✓عندما تكون استعلامات Spanner أو كود العميل بطيئًا وتحتاج إلى تشخيصه.
رابط المهارة
https://github.com/google/skills/blob/main/skills/cloud/spanner-basics/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“صمّم مخطط Cloud Spanner لتطبيق الطلبات الخاص بي، وحذرني من أي مفتاح أساسي قد يسبب نقاطًا ساخنة.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تشرح كيفية إعداد النسخ وقواعد البيانات، وتحذّر من المفاتيح الأساسية المتزايدة تسلسليًا، لأنها قد تسبب نقاطًا ساخنة. وتطلب موافقتك قبل أي تغيير في قاعدة بيانات ليست بيئة محاكاة.
المحتوى التقني (ملف 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
- Use
gcloud spanner databases ddl updateto apply schema updates (such as CREATE, ALTER, or DROP tables and indexes). - Reference schema-design.md for guidelines on primary key selection and interleaved tables.
Diagnosing Performance Issues
- Use
SPANNER_SYStables to identify slow or resource-intensive queries. - For example, query
SPANNER_SYS.QUERY_STATS_TOP_HOURto find queries with the highest CPU usage.
Reference Directory
- Core Concepts: Explanation of Spanner internals, architecture, and design.
- CLI Usage: Essential
gcloud spannercommand-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
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
finding-google-skills
22kيساعد وكيلك على إيجاد أدلة Google المناسبة لمهمة إعداد، مثل الاستضافة وقواعد البيانات والتخزين وتسجيل الدخول وتقديم نماذج الذكاء الاصطناعي.
gcloud
22kيساعد وكيلك على كتابة أوامر gcloud الخاصة بـ Google Cloud والتحقق منها، والاطلاع على الصيغة الدقيقة قبل تشغيل أي شيء حتى لا يخمّن الخيارات.
google-cloud-recipe-auth
22kيرشد وكيلك خلال هوية Google Cloud والوصول إليها، بما في ذلك طريقة دخول الأشخاص والخدمات والأذونات التي يحصلون عليها.
google-cloud-recipe-onboarding
22kيرشد مطورًا جديدًا خلال الخطوات الأولى في Google Cloud، ويشمل اختيار المشروع وربط الفوترة ونشر أول مورد.
مهارات مشابهة
discrawl
394kيتيح لوكيلك البحث في أرشيف محلي محفوظ لرسائل Discord وتلخيصه، والتحقق من مدى حداثته، وقراءة الرسائل المباشرة.
clickhouse-io
280kيساعد وكيلك على تحسين الاستعلامات والمخططات في ClickHouse وتطبيق أفضل ممارسات التحليل عالي الأداء، ويفيد عندما تكون الاستعلامات التحليلية بطيئة.
scientific-db-pubmed-database
280kيساعد وكيلك على البحث عن المقالات العلمية في المجال الطبي الحيوي. مفيد للبحوث التي تحتاج إلى معلومات طبية محددة.