$npx -y skills add ancoleman/ai-design-components --skill deploying-on-gcpImplement applications using Google Cloud Platform (GCP) services. Use when building on GCP infrastructure, selecting compute/storage/database services, designing data analytics pipelines, implementing ML workflows, or architecting cloud-native applications with BigQuery, Cloud R
| 1 | # GCP Patterns |
| 2 | |
| 3 | Build applications and infrastructure using Google Cloud Platform services with appropriate service selection, architecture patterns, and best practices. |
| 4 | |
| 5 | ## Purpose |
| 6 | |
| 7 | This skill provides decision frameworks and implementation patterns for Google Cloud Platform (GCP) services across compute, storage, databases, data analytics, machine learning, networking, and security. It guides service selection based on workload requirements and demonstrates production-ready patterns using Terraform, Python SDKs, and gcloud CLI. |
| 8 | |
| 9 | ## When to Use |
| 10 | |
| 11 | Use this skill when: |
| 12 | |
| 13 | - Selecting GCP compute services (Cloud Run, GKE, Cloud Functions, Compute Engine, App Engine) |
| 14 | - Choosing storage or database services (Cloud Storage, Cloud SQL, Spanner, Firestore, Bigtable, BigQuery) |
| 15 | - Designing data analytics pipelines (BigQuery, Pub/Sub, Dataflow, Dataproc, Composer) |
| 16 | - Implementing ML workflows (Vertex AI, AutoML, pre-trained APIs) |
| 17 | - Architecting network infrastructure (VPC, Load Balancing, CDN, Cloud Armor) |
| 18 | - Setting up IAM, security, and cost optimization |
| 19 | - Migrating from AWS or Azure to GCP |
| 20 | - Building multi-cloud or GCP-first architectures |
| 21 | |
| 22 | ## Core Concepts |
| 23 | |
| 24 | ### GCP Service Categories |
| 25 | |
| 26 | **Compute Options:** |
| 27 | - **Cloud Run:** Serverless containers for stateless HTTP services (auto-scale to zero) |
| 28 | - **GKE (Google Kubernetes Engine):** Managed Kubernetes for complex orchestration |
| 29 | - **Cloud Functions:** Event-driven functions for simple processing |
| 30 | - **Compute Engine:** Virtual machines for full OS control |
| 31 | - **App Engine:** Platform-as-a-Service for web applications |
| 32 | |
| 33 | **Storage & Databases:** |
| 34 | - **Cloud Storage:** Object storage with Standard/Nearline/Coldline/Archive tiers |
| 35 | - **Cloud SQL:** Managed PostgreSQL/MySQL/SQL Server (up to 96TB) |
| 36 | - **Cloud Spanner:** Global distributed SQL with 99.999% SLA |
| 37 | - **Firestore:** NoSQL document database with real-time sync |
| 38 | - **Bigtable:** Wide-column NoSQL for time-series and IoT (petabyte scale) |
| 39 | - **AlloyDB:** PostgreSQL-compatible with 4x performance improvement |
| 40 | |
| 41 | **Data & Analytics:** |
| 42 | - **BigQuery:** Serverless data warehouse (petabyte-scale SQL analytics) |
| 43 | - **Pub/Sub:** Global messaging and event streaming |
| 44 | - **Dataflow:** Apache Beam for stream and batch processing |
| 45 | - **Dataproc:** Managed Spark and Hadoop clusters |
| 46 | - **Cloud Composer:** Managed Apache Airflow for workflows |
| 47 | |
| 48 | **AI/ML Services:** |
| 49 | - **Vertex AI:** Unified ML platform (training, deployment, monitoring) |
| 50 | - **AutoML:** No-code ML for standard tasks |
| 51 | - **Pre-trained APIs:** Vision, Natural Language, Speech, Translation |
| 52 | - **TPUs:** Tensor Processing Units for large model training |
| 53 | |
| 54 | ### Decision Framework: Compute Service Selection |
| 55 | |
| 56 | ``` |
| 57 | Need to run code in GCP? |
| 58 | ├─ HTTP service? |
| 59 | │ ├─ YES → Stateless? |
| 60 | │ │ ├─ YES → Cloud Run (auto-scale to zero) |
| 61 | │ │ └─ NO → Need Kubernetes? → GKE | Compute Engine |
| 62 | │ └─ NO (Event-driven) |
| 63 | │ ├─ Simple function? → Cloud Functions |
| 64 | │ └─ Complex orchestration? → GKE | Cloud Run Jobs |
| 65 | ``` |
| 66 | |
| 67 | **Selection Guide:** |
| 68 | - **First choice:** Cloud Run (unless state or Kubernetes required) |
| 69 | - **Need Kubernetes:** GKE Autopilot (managed) or Standard (full control) |
| 70 | - **Simple events:** Cloud Functions (60-min max execution) |
| 71 | - **Full control:** Compute Engine (VMs with custom configuration) |
| 72 | |
| 73 | ### Decision Framework: Database Selection |
| 74 | |
| 75 | ``` |
| 76 | Choose database type: |
| 77 | ├─ Relational (SQL) |
| 78 | │ ├─ Multi-region required? → Cloud Spanner |
| 79 | │ ├─ PostgreSQL + high performance? → AlloyDB |
| 80 | │ └─ Standard RDBMS → Cloud SQL (PostgreSQL/MySQL/SQL Server) |
| 81 | │ |
| 82 | ├─ Document (NoSQL) |
| 83 | │ ├─ Mobile/web with offline sync? → Firestore |
| 84 | │ └─ Flexible schema, no offline? → MongoDB Atlas (Marketplace) |
| 85 | │ |
| 86 | ├─ Key-Value |
| 87 | │ ├─ Time-series or IoT data? → Bigtable |
| 88 | │ └─ Caching layer? → Memorystore (Redis/Memcached) |
| 89 | │ |
| 90 | └─ Analytics |
| 91 | └─ Petabyte-scale SQL analytics → BigQuery |
| 92 | ``` |
| 93 | |
| 94 | ### Decision Framework: Storage Selection |
| 95 | |
| 96 | ``` |
| 97 | Storage type needed? |
| 98 | ├─ Objects/Files |
| 99 | │ ├─ Frequent access → Cloud Storage (Standard) |
| 100 | │ ├─ Monthly access → Cloud Storage (Nearline) |
| 101 | │ ├─ Quarterly access → Cloud Storage (Coldline) |
| 102 | │ └─ Yearly access → Cloud Storage (Archive) |
| 103 | │ |
| 104 | ├─ Block storage → Persistent Disk (SSD/Standard/Extreme) |
| 105 | └─ Shared filesystem → Filestore (NFS) |
| 106 | ``` |
| 107 | |
| 108 | ### GCP vs AWS vs Azure Service Mapping |
| 109 | |
| 110 | | Category | GCP | AWS | Azure | |
| 111 | |----------|-----|-----|-------| |
| 112 | | **Serverless Containers** | Cloud Run | Fargate | Container Instances | |
| 113 | | **Kubernetes** | GKE | EKS | AKS | |
| 114 | | **Functions** | Cloud Functions | Lambda | Functions | |
| 115 | | **VMs** | Compute Engine | EC2 | Virtual Machines | |
| 116 | | **Object Storage** | Cloud Storage | S3 | Blob Storage | |
| 117 | | **SQL Database** | Cloud SQL | RDS | SQL Database | |
| 118 | | **NoSQL Docu |