Ngân hàng đề — Google Cloud Professional Cloud Developer

Tìm thấy 358 câu.

Câu 181
Your team is building an application for a financial institution. The application's frontend runs on Compute Engine, and the data resides in Cloud SQL and one Cloud Storage bucket. The application will collect data containing PII, which will be stored in the Cloud SQL database and the Cloud Storage bucket. You need to secure the PII data. What should you do?
  1. A 1. Create the relevant firewall rules to allow only the frontend to communicate with the Cloud SQL database
    2. Using IAM, allow only the frontend service account to access the Cloud Storage bucket
  2. B 1. Create the relevant firewall rules to allow only the frontend to communicate with the Cloud SQL database
    2. Enable private access to allow the frontend to access the Cloud Storage bucket privately
  3. C 1. Configure a private IP address for Cloud SQL
    2. Use VPC-SC to create a service perimeter
    3. Add the Cloud SQL database and the Cloud Storage bucket to the same service perimeter
  4. D 1. Configure a private IP address for Cloud SQL
    2. Use VPC-SC to create a service perimeter
    3. Add the Cloud SQL database and the Cloud Storage bucket to different service perimeters
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi này xoay quanh việc bảo mật dữ liệu PII (Personally Identifiable Information - thông tin nhận dạng cá nhân) trong một ứng dụng tài chính trên Google Cloud Platform (GCP).

  • Bối cảnh: Frontend chạy trên Compute Engine (VM trong VPC), dữ liệu lưu trữ ở Cloud SQL (cơ sở dữ liệu quan hệ) và một Cloud Storage bucket. Ứng dụng thu thập PII và lưu vào cả hai nơi này.
  • Mục tiêu: Bảo vệ PII khỏi rò rỉ (data exfiltration), tuân thủ các tiêu chuẩn bảo mật cao cho ngành tài chính (như PCI DSS hoặc tương đương). Cần giải pháp toàn diện, không chỉ network isolation mà còn kiểm soát dịch vụ để ngăn chặn truy cập trái phép giữa các tài nguyên GCP.
  • Thách thức chính: Đảm bảo chỉ frontend (trong VPC) truy cập được Cloud SQL và Storage, tránh public exposure, và ngăn data di chuyển ra ngoài perimeter an toàn.
  • Kiến thức cập nhật (2026): Sử dụng Private IP cho Cloud SQL (private services access), VPC Service Controls (VPC-SC) với service perimeters (theo docs GCP mới nhất, VPC-SC 2025+ hỗ trợ tích hợp chặt chẽ hơn với AlloyDB/Cloud SQL và Storage cho zero-trust security).

📘 Tài liệu tham khảo:

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng:

  1. Configure a private IP address for Cloud SQL
  2. Use VPC-SC to create a service perimeter
  3. Add the Cloud SQL database and the Cloud Storage bucket to the same service perimeter

Lý do chọn đáp án này 🛡️:

  • Private IP cho Cloud SQL ✅: Chuyển Cloud SQL từ public IP sang private IP (sử dụng Private Services Access/VPC peering), đảm bảo chỉ VM trong cùng VPC (như frontend Compute Engine) truy cập được, loại bỏ rủi ro public exposure.
  • VPC-SC service perimeter ✅: Tạo "hàng rào" logic bao quanh các dịch vụ GCP, chặn data exfiltration (PII không thể copy ra ngoài perimeter qua API hoặc network).
  • Cùng một perimeter ✅: Cloud SQL và Storage bucket phải ở cùng perimeter để frontend (trong VPC protected) truy cập được cả hai mà không vi phạm policy (VPC-SC cho phép ingress/egress nội bộ perimeter). Giải pháp này toàn diện, zero-trust, phù hợp PII financial. Nếu khác perimeter, access bị block.

📋 Giải thích chi tiết tất cả các phương án

Dưới đây là phân tích từng phương án, giữ nguyên nội dung gốc tiếng Anh. Mỗi phương án được đánh giá đúng/sai với lý do cụ thể:

  • ❌ Phương án SAI 1:

    1. Create the relevant firewall rules to allow only the frontend to communicate with the Cloud SQL database
    2. Using IAM, allow only the frontend service account to access the Cloud Storage bucket
      Lý do sai 🚫: Firewall rules chỉ kiểm soát network traffic đến Cloud SQL (nhưng nếu SQL dùng public IP, vẫn rủi ro DDoS/exposure). IAM cho Storage là access control cơ bản, không ngăn data exfiltration (PII có thể bị copy qua API public). Không đủ cho PII financial, thiếu isolation dịch vụ (VPC-SC).
  • ❌ Phương án SAI 2:

    1. Create the relevant firewall rules to allow only the frontend to communicate with the Cloud SQL database
    2. Enable private access to allow the frontend to access the Cloud Storage bucket privately
      Lý do sai 🚫: Tương tự phương án 1, firewall không giải quyết public IP của SQL. "Private access" cho Storage (VPC endpoint) chỉ private hóa network đến bucket, nhưng không có service perimeter để chặn exfiltration giữa SQL và Storage. Vẫn thiếu bảo vệ toàn diện PII.
  • ✅ Phương án ĐÚNG (như đã giải thích ở trên):

    1. Configure a private IP address for Cloud SQL
    2. Use VPC-SC to create a service perimeter
    3. Add the Cloud SQL database and the Cloud Storage bucket to the same service perimeter
      Lý do đúng 🛡️: Kết hợp private network + VPC-SC perimeter chung tạo lớp bảo mật đa tầng: private access nội bộ VPC + chặn data leak qua API. Hoàn hảo cho PII, frontend Compute Engine access suôn sẻ.
  • ❌ Phương án SAI 4:

    1. Configure a private IP address for Cloud SQL
    2. Use VPC-SC to create a service perimeter
    3. Add the Cloud SQL database and the Cloud Storage bucket to different service perimeters
      Lý do sai 🚫: Private IP tốt, VPC-SC tốt, nhưng khác perimeter gây vấn đề: VPC-SC drydock policy chặn data di chuyển giữa perimeters (PII từ SQL không thể sync/copy sang Storage hoặc ngược lại). Frontend có thể access riêng lẻ, nhưng ứng dụng bị break, không khả thi. Phải cùng perimeter mới hoạt động!
Câu 182
You are designing a chat room application that will host multiple rooms and retain the message history for each room. You have selected Firestore as your database. How should you represent the data in Firestore?
  1. A Create a collection for the rooms. For each room, create a document that lists the contents of the messages


  2. B Create a collection for the rooms. For each room, create a collection that contains a document for each message


  3. C Create a collection for the rooms. For each room, create a document that contains a collection for documents, each of which contains a message.


  4. D Create a collection for the rooms, and create a document for each room. Create a separate collection for messages, with one document per message. Each room’s document contains a list of references to the messages.

Xem giải thích

🧩 Phân tích chi tiết câu hỏi

📘 Nội dung câu hỏi:
Câu hỏi yêu cầu thiết kế mô hình dữ liệu trong Firestore (dịch vụ NoSQL database của Google Cloud) cho một ứng dụng chat room. Ứng dụng cần hỗ trợ nhiều phòng chat (rooms), mỗi phòng lưu trữ lịch sử tin nhắn (message history). Firestore có cấu trúc phân cấp: collection chứa các document, và document có thể chứa subcollection (collection con). Mục tiêu là tối ưu hóa cho việc đọc/ghi tin nhắn theo phòng, tránh vượt giới hạn kích thước document (1MB), và hỗ trợ query hiệu quả (như lấy toàn bộ lịch sử tin nhắn của một phòng cụ thể).

Câu hỏi kèm 4 sơ đồ minh họa cấu trúc dữ liệu (từ hình ảnh image2.png đến image5.png):

  • Hình 1 (image2.png): Rooms (collection) → Một document Room chứa danh sách messages bên trong.
  • Hình 2 (image3.png): Rooms (collection) → Room (collection) → Các document Message.
  • Hình 3 (image4.png): Rooms (collection) → Document Room → Subcollection Messages → Các document Message.
  • Hình 4 (image5.png): Rooms (collection) → Document Room, và riêng biệt Messages (collection) → Document Message, với Room chứa references đến messages.

🛠️ Lý do cần thiết kế tốt: Trong chat app, tin nhắn tăng nhanh (high write throughput), cần scale ngang, query realtime (Firestore hỗ trợ listeners), và tránh fan-out/fan-in phức tạp. Best practice Firestore (cập nhật đến 2026): Sử dụng subcollections cho dữ liệu hierarchical như messages per room.

✅ Đáp án đúng

Create a collection for the rooms. For each room, create a document that contains a collection for documents, each of which contains a message. (Tương ứng hình image4.png)

Lý do chọn:
✅ Cấu trúc lý tưởng: Collection rooms chứa các document room (mỗi room là 1 document với metadata như tên phòng). Mỗi document room chứa subcollection messages với các document message (chứa nội dung, timestamp, user).
✅ Ưu điểm:

  • Query hiệu quả: db.collection('rooms').doc('roomId').collection('messages').orderBy('timestamp').limit(50) để lấy tin nhắn realtime theo phòng.
  • Scale tốt: Subcollection không giới hạn bởi document size, hỗ trợ indexes composite cho sort/filter.
  • Realtime listeners: Dễ attach listener chỉ cho subcollection của room cụ thể, giảm chi phí read.
  • Phù hợp best practice Firestore cho chat (không thay đổi đến 2026).

❌ Phân tích tất cả các phương án

  • Phương án 1 [SAI]: Create a collection for the rooms. For each room, create a document that lists the contents of the messages (Hình image2.png: Rooms → Room document chứa list messages).
    ❌ Sai vì: Lưu messages dưới dạng array/list bên trong document room vi phạm giới hạn 1MB/document. Chat room có thể có hàng nghìn messages → document phình to, không thể update (Firestore chỉ atomic update toàn document). Query kém (không index sâu array), khó paginate. Không scale cho write-heavy workload.

  • Phương án 2 [SAI]: Create a collection for the rooms. For each room, create a collection that contains a document for each message (Hình image3.png: Rooms → Room collection → Message documents).
    ❌ Sai vì: Collection không thể là document trực tiếp – Rooms là collection chứa documents, không thể có "Room collection" con trực tiếp mà không qua document cha. Cấu trúc này không hợp lệ trong Firestore (collection phải thuộc document hoặc root). Dẫn đến query khó khăn, không hierarchical đúng.

  • Phương án 3 [ĐÚNG]: Create a collection for the rooms. For each room, create a document that contains a collection for documents, each of which contains a message (Hình image4.png: Rooms → Room document → Messages subcollection → Message documents).
    ✅ Đúng như đã giải thích ở trên. Hoàn hảo cho hierarchical data, query con (subcollection queries), và sharding tự động.

  • Phương án 4 [SAI]: Create a collection for the rooms, and create a document for each room. Create a separate collection for messages, with one document per message. Each room’s document contains a list of references to the messages (Hình image5.png: Rooms → Room docs | Messages collection riêng → Message docs, Room chứa refs).
    ❌ Sai vì: Messages ở collection global riêng, mỗi message có field roomId. Room doc chứa array references (document IDs). Vấn đề:

    • Query toàn bộ messages của room: Phải where('roomId', '==', roomId) → kém hiệu quả nếu nhiều rooms (scan toàn collection, hotspot writes).
    • Array refs trong room doc lại gặp vấn đề size limit như phương án 1.
    • Không tận dụng subcollections → khó realtime per room, tăng chi phí read.

📚 Tài liệu tham khảo

  • Firestore Best Practices for Chat Apps: Google Cloud Firestore Docs - Model Chat Data (cập nhật 2024-2026, khuyến nghị subcollections cho messages).
  • Firestore Data Model: Cloud Firestore Data Structure – Giải thích collections, documents, subcollections.
  • Query Limitations: Firestore Limits – 1MB/doc, subcollection queries không scan global.
  • Exam Reference: ExamTopics Professional Cloud Developer (hình ảnh từ đây khớp best practice GCP).

💡 Lời khuyên: Trong thực tế, thêm indexes cho timestamp và userId trong subcollection để optimize sort/filter. Sử dụng batched writes cho high-throughput chat! 🚀

Câu 183
You are developing an application that will handle requests from end users. You need to secure a Cloud Function called by the application to allow authorized end users to authenticate to the function via the application while restricting access to unauthorized users. You will integrate Google Sign-In as part of the solution and want to follow Google-recommended best practices. What should you do?
  1. A Deploy from a source code repository and grant users the roles/cloudfunctions.viewer role.
  2. B Deploy from a source code repository and grant users the roles/cloudfunctions.invoker role
  3. C Deploy from your local machine using gcloud and grant users the roles/cloudfunctions.admin role
  4. D Deploy from your local machine using gcloud and grant users the roles/cloudfunctions.developer role
Xem giải thích

🧩 Phân tích chi tiết câu hỏi

Câu hỏi tập trung vào việc bảo mật một Cloud Function trong Google Cloud Platform (GCP) khi ứng dụng xử lý yêu cầu từ người dùng cuối (end users). ✅ Cụ thể, bạn cần:

  • Cho phép người dùng được ủy quyền (authorized end users) xác thực qua ứng dụng và gọi (invoke) Cloud Function.
  • Hạn chế truy cập từ người dùng không được ủy quyền (unauthorized users).
  • Tích hợp Google Sign-In làm phần của giải pháp.
  • Tuân thủ best practices được Google khuyến nghị.

🛠️ Bối cảnh kỹ thuật: Cloud Functions là dịch vụ serverless trong GCP. Để bảo mật invocation (gọi hàm), GCP sử dụng IAM (Identity and Access Management) với các role cụ thể. Với Google Sign-In, người dùng được xác thực qua Identity Platform hoặc Firebase Auth, sau đó map principal (như user email) vào IAM policy để grant quyền invoke. Best practice bao gồm deploy từ source repository (cho CI/CD an toàn, traceability) và sử dụng role tối thiểu (principle of least privilege). Kiến thức cập nhật đến 2026: Cloud Functions (Gen 2) hỗ trợ IAM-based auth cho HTTP functions, khuyến nghị roles/cloudfunctions.invoker cho end-user invocation (không dùng public/anonymous access).

📘 Tài liệu tham khảo:

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Deploy from a source code repository and grant users the roles/cloudfunctions.invoker role.

Lý do 🏆:

  • Deploy từ source code repository (như Cloud Source Repositories hoặc GitHub) là best practice của Google cho production, đảm bảo version control, audit trail, và tích hợp CI/CD (Cloud Build). Tránh deploy thủ công từ local để giảm rủi ro bảo mật và lỗi con người.
  • Grant roles/cloudfunctions.invoker: Đây là role tối thiểu cần thiết để end users (sau khi auth qua Google Sign-In) có thể invoke (gọi) function. Role này chỉ cho phép gọi HTTP-triggered functions mà không cho phép quản lý/deploy/delete, tuân thủ least privilege. Với Google Sign-In, bạn bind IAM policy cho user principals (e.g., user:example@gmail.com@cloudfunctions.invoker).

❌ Giải thích tất cả các phương án (đúng/sai)

  • Deploy from a source code repository and grant users the roles/cloudfunctions.viewer role
    ❌ Sai: Role roles/cloudfunctions.viewer chỉ cho phép xem metadata của function (như source code, logs), không invoke được. Không đáp ứng yêu cầu cho end users gọi function. Deploy từ repo đúng nhưng role sai.

  • Deploy from a source code repository and grant users the roles/cloudfunctions.invoker role
    ✅ Đúng: Như giải thích ở trên. Kết hợp deploy best practice + role chính xác cho invocation sau Google Sign-In. Hoàn hảo tuân thủ Google-recommended practices.

  • Deploy from your local machine using gcloud and grant users the roles/cloudfunctions.admin role
    ❌ Sai: Deploy từ local bằng gcloud không phải best practice (thiếu traceability, khó scale cho team). Role roles/cloudfunctions.admin quá rộng (full control: create/update/delete/invoke), vi phạm least privilege – end users chỉ cần invoke, không cần admin.

  • Deploy from your local machine using gcloud and grant users the roles/cloudfunctions.developer role
    ❌ Sai: Deploy từ local sai như trên. Role roles/cloudfunctions.developer cho phép deploy/update/delete functions, không dành cho end users (chỉ cần invoke). Quá quyền hạn và không an toàn cho authorized users.

🧠 Lưu ý bổ sung: Để triển khai đầy đủ, sau deploy: Sử dụng gcloud functions add-iam-policy-binding để grant invoker cho user groups từ Google Sign-In. Test với allUsers bị deny mặc định cho private functions. Nếu dùng Eventarc/Gen2, kiểm tra Cloud Run IAM tương đương! 🚀

Câu 184
You are running a web application on Google Kubernetes Engine that you inherited. You want to determine whether the application is using libraries with known vulnerabilities or is vulnerable to XSS attacks. Which service should you use?
  1. A Google Cloud Armor
  2. B Debugger
  3. C Web Security Scanner
  4. D Error Reporting
Xem giải thích

🧩 Phân tích chi tiết câu hỏi trắc nghiệm

📖 Nội dung câu hỏi:
Câu hỏi mô tả tình huống bạn đang quản lý một ứng dụng web chạy trên Google Kubernetes Engine (GKE) – một dịch vụ container orchestration của Google Cloud – mà bạn kế thừa từ người khác. Mục tiêu là kiểm tra xem ứng dụng có sử dụng các thư viện (libraries) chứa lỗ hổng bảo mật đã biết hay không, đồng thời phát hiện các lỗ hổng kiểu XSS (Cross-Site Scripting). XSS là một loại tấn công phổ biến nơi kẻ xấu chèn mã độc vào trang web để đánh cắp dữ liệu người dùng. Bạn cần chọn dịch vụ Google Cloud phù hợp nhất để quét và xác định các vấn đề này một cách tự động, không phải công cụ thủ công.

✅ Đáp án đúng: Web Security Scanner
Lý do lựa chọn: Web Security Scanner là dịch vụ chuyên dụng của Google Cloud để quét tự động lỗ hổng bảo mật trên ứng dụng web, hỗ trợ trực tiếp trên GKE (cũng như App Engine, Compute Engine, Cloud Run). Nó kiểm tra:

  • Các thư viện dependencies có lỗ hổng đã biết (dựa trên cơ sở dữ liệu OWASP).
  • Các lỗ hổng XSS, CSRF, injection,... bằng cách mô phỏng tấn công thực tế.
    Dịch vụ này tích hợp dễ dàng với GKE qua scans managed hoặc scheduled, báo cáo chi tiết và remediation steps. Đây là lựa chọn tối ưu cho kịch bản kế thừa ứng dụng cần kiểm tra nhanh chóng (cập nhật đến 2026: hỗ trợ Container-Optimized OS và Workload Identity Federation mới nhất).

🛠️ Phân tích tất cả các phương án trả lời:

  • Google Cloud Armor ❌
    Giải thích sai: Đây là dịch vụ Web Application Firewall (WAF) và bảo vệ DDoS cho các HTTP(S) Load Balancer. Nó chặn traffic độc hại thời gian thực (như SQL injection, XSS patterns) nhưng không quét chủ động lỗ hổng trong code/libraries hay kiểm tra ứng dụng kế thừa. Phù hợp phòng thủ, không phải kiểm tra vulnerability scanning.

  • Debugger ❌
    Giải thích sai: Cloud Debugger cho phép debug code thời gian thực bằng cách đặt breakpoints mà không cần redeploy (hỗ trợ GKE qua sidecar). Tuy nhiên, nó chỉ dùng để sửa lỗi lập trình, không phát hiện lỗ hổng bảo mật như XSS hay thư viện vulnerable. Không liên quan đến security scanning.

  • Web Security Scanner ✅
    Giải thích đúng: Như đã nêu ở trên, đây là công cụ chính xác nhất cho việc quét lỗ hổng trên GKE, bao gồm kiểm tra libraries (OWASP top 10 dependencies) và XSS attacks. Hỗ trợ scan authenticated/unauthenticated, tích hợp CI/CD, và báo cáo tích hợp với Security Command Center (cập nhật 2026: hỗ trợ AI-driven false positive reduction).

  • Error Reporting ❌
    Giải thích sai: Dịch vụ này thu thập và báo cáo lỗi runtime từ ứng dụng (logs từ Cloud Logging), giúp theo dõi crash hoặc exception. Nó không quét lỗ hổng bảo mật chủ động như XSS hay thư viện vulnerable, chỉ phản ứng sau khi lỗi xảy ra.

📘 Tài liệu tham khảo chính thức (Google Cloud, cập nhật đến 2026):

Câu 185
You are building a highly available and globally accessible application that will serve static content to users. You need to configure the storage and serving components. You want to minimize management overhead and latency while maximizing reliability for users. What should you do?
  1. A 1. Create a managed instance group. Replicate the static content across the virtual machines (VMs)
    2. Create an external HTTP(S) load balancer.
    3. Enable Cloud CDN, and send traffic to the managed instance group.
  2. B 1. Create an unmanaged instance group. Replicate the static content across the VMs.
    2. Create an external HTTP(S) load balancer
    3. Enable Cloud CDN, and send traffic to the unmanaged instance group.
  3. C 1. Create a Standard storage class, regional Cloud Storage bucket. Put the static content in the bucket
    2. Reserve an external IP address, and create an external HTTP(S) load balancer
    3. Enable Cloud CDN, and send traffic to your backend bucket
  4. D 1. Create a Standard storage class, multi-regional Cloud Storage bucket. Put the static content in the bucket.
    2. Reserve an external IP address, and create an external HTTP(S) load balancer.
    3. Enable Cloud CDN, and send traffic to your backend bucket.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi yêu cầu xây dựng một ứng dụng có tính sẵn sàng cao (highly available), có thể truy cập toàn cầu (globally accessible), phục vụ nội dung tĩnh (static content) cho người dùng. Các yêu cầu chính bao gồm:

  • Tối ưu hóa: Giảm thiểu overhead quản lý (management overhead), giảm độ trễ (latency).
  • Tối đa hóa: Độ tin cậy (reliability) cho người dùng.
  • Thành phần chính: Cấu hình lưu trữ (storage) và phục vụ (serving) nội dung tĩnh một cách hiệu quả trên Google Cloud Platform (GCP).

📘 Bối cảnh GCP (cập nhật đến 2026): Nội dung tĩnh lý tưởng dùng Cloud Storage kết hợp Cloud CDN và External HTTP(S) Load Balancer để đạt HA toàn cầu, tự động scale, không cần quản lý server. Không dùng VM/instance group vì overhead cao cho static content (theo docs GCP mới nhất: Cloud Storage hỗ trợ Multi-Regional cho durability 99.95%, latency thấp; Cloud CDN tích hợp Anycast cho global distribution).

Nguồn tham khảo:

✅ Đáp án đúng: Phương án 4

Lý do chọn:

  • Sử dụng Standard storage class, multi-regional Cloud Storage bucket để lưu trữ: Đảm bảo durability cao (99.95%), phân tán toàn cầu (US, EU, Asia), giảm latency tự nhiên mà không cần quản lý server (zero overhead).
  • Reserve external IP + External HTTP(S) LB: Cung cấp IP global anycast, routing thông minh đến edge gần user nhất.
  • Cloud CDN: Cache nội dung tại 300+ PoPs toàn cầu, tối ưu latency <50ms, tăng reliability với failover tự động. Kết hợp hoàn hảo: HA toàn cầu, low latency, minimal management (serverless). Phù hợp best practice GCP 2026.

🛠️ Phân tích chi tiết tất cả các phương án

Dưới đây là giải thích từng phương án một cách đầy đủ, giữ nguyên văn bản gốc tiếng Anh. Mỗi bước trong phương án được đánh giá riêng:

  • Phương án 1 ❌ SAI hoàn toàn:

    1. Create a managed instance group. Replicate the static content across the virtual machines (VMs) → Không phù hợp: Managed Instance Group (MIG) dùng cho dynamic apps, phải manually replicate static files qua VMs → overhead cao (quản lý OS, patching, scaling), không serverless, kém reliability nếu VM fail.
    2. Create an external HTTP(S) load balancer → Bước này OK, nhưng backend là MIG kém.
    3. Enable Cloud CDN, and send traffic to the managed instance group → CDN OK, nhưng source từ MIG → latency cao (VM không global), không minimize overhead. Tổng: Overhead lớn, không optimal cho static content.
  • Phương án 2 ❌ SAI hoàn toàn:

    1. Create an unmanaged instance group. Replicate the static content across the VMs → Tệ hơn MIG: Unmanaged IG yêu cầu manual scaling/replication, không auto-healing → reliability thấp, overhead cực cao.
    2. Create an external HTTP(S) load balancer → OK, nhưng backend kém.
    3. Enable Cloud CDN, and send traffic to the unmanaged instance group → CDN không cứu nổi backend thủ công. Tổng: Không HA, không global, vi phạm tất cả yêu cầu.
  • Phương án 3 ❌ SAI một phần:

    1. Create a Standard storage class, regional Cloud Storage bucket. Put the static content in the bucket → Gần đúng nhưng SAI: Regional bucket chỉ trong 1 region (ví dụ us-central1) → latency cao cho global users, durability chỉ 99.9%, không HA toàn cầu (multi-regional mới đạt 99.95% với geo-redundancy).
    2. Reserve an external IP address, and create an external HTTP(S) load balancer → OK, hỗ trợ backend bucket.
    3. Enable Cloud CDN, and send traffic to your backend bucket → OK, nhưng bucket regional → CDN vẫn phải fetch từ 1 region → latency kém so với multi-regional. Tổng: Không maximize reliability/global access (theo GCP docs: Regional không khuyến nghị cho global static serving).
  • Phương án 4 ✅ ĐÚNG (như đã giải thích trên):

    1. Create a Standard storage class, multi-regional Cloud Storage bucket. Put the static content in the bucket → Hoàn hảo: Multi-regional tự replicate cross-continent, low latency globally.
    2. Reserve an external IP address, and create an external HTTP(S) load balancer → Chuẩn: Global LB với premium tier cho anycast routing.
    3. Enable Cloud CDN, and send traffic to your backend bucket → Tối ưu: CDN cache tại edge, origin là bucket multi-reg → latency minimal, reliability max.

Kết luận 💡: Phương án 4 là best practice GCP cho static websites/apps (ví dụ: Hosting static sites with CDN). Tránh VM cho static để giảm chi phí/overhead lên đến 90%!

Câu 186
Case study -

This is a case study. Case studies are not timed separately. You can use as much exam time as you would like to complete each case. However, there may be additional case studies and sections on this exam. You must manage your time to ensure that you are able to complete all questions included on this exam in the time provided.

To answer the questions included in a case study, you will need to reference information that is provided in the case study. Case studies might contain exhibits and other resources that provide more information about the scenario that is described in the case study. Each question is independent of the other questions in this case study.

At the end of this case study, a review screen will appear. This screen allows you to review your answers and to make changes before you move to the next section of the exam. After you begin a new section, you cannot return to this section.


To start the case study -
To display the first question in this case study, click the Next button. Use the buttons in the left pane to explore the content of the case study before you answer the questions. Clicking these buttons displays information such as business requirements, existing environment, and problem statements. If the case study has an All Information tab, note that the information displayed is identical to the information displayed on the subsequent tabs. When you are ready to answer a question, click the Question button to return to the question.


Company Overview -
HipLocal is a community application designed to facilitate communication between people in close proximity. It is used for event planning and organizing sporting events, and for businesses to connect with their local communities. HipLocal launched recently in a few neighborhoods in Dallas and is rapidly growing into a global phenomenon. Its unique style of hyper-local community communication and business outreach is in demand around the world.


Executive Statement -
We are the number one local community app; it's time to take our local community services global. Our venture capital investors want to see rapid growth and the same great experience for new local and virtual communities that come online, whether their members are 10 or 10000 miles away from each other.


Solution Concept -
HipLocal wants to expand their existing service, with updated functionality, in new regions to better serve their global customers. They want to hire and train a new team to support these regions in their time zones. They will need to ensure that the application scales smoothly and provides clear uptime data, and that they analyze and respond to any issues that occur.


Existing Technical Environment -
HipLocal's environment is a mix of on-premises hardware and infrastructure running in Google Cloud Platform. The HipLocal team understands their application well, but has limited experience in global scale applications. Their existing technical environment is as follows:
• Existing APIs run on Compute Engine virtual machine instances hosted in GCP.
• State is stored in a single instance MySQL database in GCP.
• Release cycles include development freezes to allow for QA testing.
• The application has no logging.
• Applications are manually deployed by infrastructure engineers during periods of slow traffic on weekday evenings.
• There are basic indicators of uptime; alerts are frequently fired when the APIs are unresponsive.


Business Requirements -
HipLocal's investors want to expand their footprint and support the increase in demand they are seeing. Their requirements are:
• Expand availability of the application to new regions.
• Support 10x as many concurrent users.
• Ensure a consistent experience for users when they travel to different regions.
• Obtain user activity metrics to better understand how to monetize their product.
• Ensure compliance with regulations in the new regions (for example, GDPR).
• Reduce infrastructure management time and cost.
• Adopt the Google-recommended practices for cloud computing.
○ Develop standardized workflows and processes around application lifecycle management.
○ Define service level indicators (SLIs) and service level objectives (SLOs).


Technical Requirements -
• Provide secure communications between the on-premises data center and cloud-hosted applications and infrastructure.
• The application must provide usage metrics and monitoring.
• APIs require authentication and authorization.
• Implement faster and more accurate validation of new features.
• Logging and performance metrics must provide actionable information to be able to provide debugging information and alerts.
• Must scale to meet user demand.


For this question refer to the HipLocal case study.

HipLocal wants to reduce the latency of their services for users in global locations. They have created read replicas of their database in locations where their users reside and configured their service to read traffic using those replicas. How should they further reduce latency for all database interactions with the least amount of effort?
  1. A Migrate the database to Bigtable and use it to serve all global user traffic.
  2. B Migrate the database to Cloud Spanner and use it to serve all global user traffic.
  3. C Migrate the database to Firestore in Datastore mode and use it to serve all global user traffic.
  4. D Migrate the services to Google Kubernetes Engine and use a load balancer service to better scale the application.
Xem giải thích

🧩 Phân tích chi tiết câu hỏi

Câu hỏi thuộc case study về công ty HipLocal, một ứng dụng cộng đồng hyper-local đang mở rộng toàn cầu trên Google Cloud Platform (GCP). Họ đang gặp vấn đề về latency (độ trễ) dịch vụ cho người dùng ở các vị trí toàn cầu. Hiện tại:

  • Database gốc là single instance MySQL trên GCP.
  • Họ đã triển khai read replicas ở các vùng (regions) nơi người dùng cư trú, và cấu hình dịch vụ để chỉ đọc dữ liệu (read traffic) từ các replicas này.
  • Mục tiêu: Giảm thêm latency cho TẤT CẢ các tương tác database (all database interactions), bao gồm cả reads và writes, với ít nỗ lực nhất (least amount of effort).
  • Bối cảnh kinh doanh: Cần scale 10x users, consistent experience toàn cầu, metrics, compliance (như GDPR), và áp dụng best practices GCP như SLIs/SLOs.
  • Yêu cầu kỹ thuật: Secure comms, metrics/monitoring, auth, faster validation, logging, scale theo demand.

Câu hỏi tập trung vào giải pháp database-centric để giảm latency toàn cầu một cách đơn giản, tận dụng tính năng native của GCP mà không thay đổi lớn kiến trúc app. 📘 Lưu ý: Đây là GCP (không phải AWS), kiến thức dựa trên phiên bản mới nhất GCP đến 2026 (Cloud Spanner v2+ với multi-region configs, Bigtable cbt v2, Firestore native mode).

✅ Đáp án đúng: Migrate the database to Cloud Spanner and use it to serve all global user traffic.

Lý do lựa chọn:

  • Cloud Spanner là database relational, globally distributed của GCP, hỗ trợ strong consistency cho cả reads/writes với latency thấp (~10-50ms global) nhờ TrueTime và Paxos replication tự động multi-region.
  • Họ đã có read replicas MySQL → Migrate sang Spanner sẽ xử lý ALL interactions (reads + writes) globally mà không cần config replicas thủ công, giảm effort tối đa (migrate schema/tools như Database Migration Service - DMS).
  • Least effort: Spanner tương thích SQL (gần MySQL), auto-scale, 99.999% uptime, tích hợp metrics/SLOs native. Phù hợp business req: global scale, consistent UX, compliance (regional configs).
  • Cập nhật 2026: Spanner hỗ trợ foreign keys, JSON, vector search cho app community như HipLocal.

Nguồn tham khảo:

🛠️ Giải thích tất cả các phương án

  • ❌ [SAI] Migrate the database to Bigtable and use it to serve all global user traffic.
    Bigtable là NoSQL wide-column cho big data/analytics (như time-series), không hỗ trợ SQL relational như MySQL của HipLocal (cần joins, transactions). Migrate effort cao (schema redesign), latency tốt nhưng không strong consistent globally cho writes như Spanner. Không phù hợp app cần relational data (user events, state).

  • ✅ [ĐÚNG] Migrate the database to Cloud Spanner and use it to serve all global user traffic.
    (Giải thích chi tiết ở phần trên). Giảm latency toàn diện, least effort cho relational workload global.

  • ❌ [SAI] Migrate the database to Firestore in Datastore mode and use it to serve all global user traffic.
    Firestore (Datastore mode) là NoSQL document cho mobile/web apps, không relational (thiếu complex queries/joins). Latency thấp multi-region nhưng eventual consistency mặc định, writes kém hơn Spanner. Effort cao refactor schema từ MySQL, không ideal cho stateful app như HipLocal.

  • ❌ [SAI] Migrate the services to Google Kubernetes Engine and use a load balancer service to better scale the application.
    GKE + Load Balancer scale ứng dụng/services (Compute Engine APIs), không giải quyết database latency (vẫn dùng MySQL replicas có writes bottleneck ở primary). Không "least effort" cho DB interactions, chỉ giúp app layer (multi-regional GCLB), bỏ qua root cause DB global.

Kết luận 💡: Chọn Spanner để tối ưu toàn cầu hóa DB với effort thấp nhất, phù hợp Google-recommended practices (SRE book: global dist systems). HipLocal có thể dùng DMS để migrate seamless! 🚀

Câu 187
Case study -

This is a case study. Case studies are not timed separately. You can use as much exam time as you would like to complete each case. However, there may be additional case studies and sections on this exam. You must manage your time to ensure that you are able to complete all questions included on this exam in the time provided.

To answer the questions included in a case study, you will need to reference information that is provided in the case study. Case studies might contain exhibits and other resources that provide more information about the scenario that is described in the case study. Each question is independent of the other questions in this case study.

At the end of this case study, a review screen will appear. This screen allows you to review your answers and to make changes before you move to the next section of the exam. After you begin a new section, you cannot return to this section.


To start the case study -
To display the first question in this case study, click the Next button. Use the buttons in the left pane to explore the content of the case study before you answer the questions. Clicking these buttons displays information such as business requirements, existing environment, and problem statements. If the case study has an All Information tab, note that the information displayed is identical to the information displayed on the subsequent tabs. When you are ready to answer a question, click the Question button to return to the question.


Company Overview -
HipLocal is a community application designed to facilitate communication between people in close proximity. It is used for event planning and organizing sporting events, and for businesses to connect with their local communities. HipLocal launched recently in a few neighborhoods in Dallas and is rapidly growing into a global phenomenon. Its unique style of hyper-local community communication and business outreach is in demand around the world.


Executive Statement -
We are the number one local community app; it's time to take our local community services global. Our venture capital investors want to see rapid growth and the same great experience for new local and virtual communities that come online, whether their members are 10 or 10000 miles away from each other.


Solution Concept -
HipLocal wants to expand their existing service, with updated functionality, in new regions to better serve their global customers. They want to hire and train a new team to support these regions in their time zones. They will need to ensure that the application scales smoothly and provides clear uptime data, and that they analyze and respond to any issues that occur.


Existing Technical Environment -
HipLocal's environment is a mix of on-premises hardware and infrastructure running in Google Cloud Platform. The HipLocal team understands their application well, but has limited experience in global scale applications. Their existing technical environment is as follows:
• Existing APIs run on Compute Engine virtual machine instances hosted in GCP.
• State is stored in a single instance MySQL database in GCP.
• Release cycles include development freezes to allow for QA testing.
• The application has no logging.
• Applications are manually deployed by infrastructure engineers during periods of slow traffic on weekday evenings.
• There are basic indicators of uptime; alerts are frequently fired when the APIs are unresponsive.


Business Requirements -
HipLocal's investors want to expand their footprint and support the increase in demand they are seeing. Their requirements are:
• Expand availability of the application to new regions.
• Support 10x as many concurrent users.
• Ensure a consistent experience for users when they travel to different regions.
• Obtain user activity metrics to better understand how to monetize their product.
• Ensure compliance with regulations in the new regions (for example, GDPR).
• Reduce infrastructure management time and cost.
• Adopt the Google-recommended practices for cloud computing.
○ Develop standardized workflows and processes around application lifecycle management.
○ Define service level indicators (SLIs) and service level objectives (SLOs).


Technical Requirements -
• Provide secure communications between the on-premises data center and cloud-hosted applications and infrastructure.
• The application must provide usage metrics and monitoring.
• APIs require authentication and authorization.
• Implement faster and more accurate validation of new features.
• Logging and performance metrics must provide actionable information to be able to provide debugging information and alerts.
• Must scale to meet user demand.


For this question, refer to the HipLocal case study.

Which Google Cloud product addresses HipLocal’s business requirements for service level indicators and objectives?
  1. A Cloud Profiler
  2. B Cloud Monitoring
  3. C Cloud Trace
  4. D Cloud Logging
Xem giải thích

🧩 Phân tích chi tiết câu hỏi trắc nghiệm

📖 Nội dung câu hỏi:
Câu hỏi thuộc case study HipLocal – một ứng dụng cộng đồng hyper-local đang mở rộng toàn cầu từ Google Cloud Platform (GCP). HipLocal có môi trường hiện tại kết hợp on-premises và GCP (Compute Engine, MySQL), với các vấn đề như thiếu logging, triển khai thủ công, và chỉ có chỉ số uptime cơ bản. Yêu cầu kinh doanh chính liên quan: Mở rộng quy mô, hỗ trợ 10x người dùng đồng thời, đảm bảo trải nghiệm nhất quán, thu thập metrics hoạt động người dùng, tuân thủ quy định (như GDPR), giảm chi phí quản lý hạ tầng, và áp dụng các thực hành khuyến nghị của Google cho cloud computing, bao gồm:

  • Phát triển quy trình chuẩn hóa cho lifecycle management.
  • Định nghĩa Service Level Indicators (SLIs) và Service Level Objectives (SLOs).

Câu hỏi cụ thể: "Which Google Cloud product addresses HipLocal’s business requirements for service level indicators and objectives?" (Sản phẩm Google Cloud nào đáp ứng yêu cầu kinh doanh của HipLocal về SLIs và SLOs?).
🛠️ Bối cảnh: SLIs là các chỉ số đo lường hiệu suất dịch vụ (như latency, availability), SLOs là mục tiêu dựa trên SLIs (ví dụ: 99.9% uptime). HipLocal cần công cụ để định nghĩa, theo dõi và báo cáo chúng để đảm bảo độ tin cậy và mở rộng toàn cầu.

✅ Đáp án đúng: Cloud Monitoring
Lý do lựa chọn: Cloud Monitoring là sản phẩm cốt lõi của Google Cloud để theo dõi, đo lường và quản lý SLIs/SLOs. Nó cho phép tạo dashboards, alerts, và Error Budgets dựa trên SLOs, giúp HipLocal phân tích uptime, metrics người dùng, và phản ứng nhanh với sự cố. Điều này trực tiếp đáp ứng yêu cầu "Define service level indicators (SLIs) and service level objectives (SLOs)" trong Business Requirements, đồng thời hỗ trợ Technical Requirements như monitoring, metrics, và alerts. Theo tài liệu Google Cloud cập nhật 2024-2026, Cloud Monitoring tích hợp SRE practices (Site Reliability Engineering) để quản lý dịch vụ quy mô lớn.
📘 Nguồn tham khảo:

🔍 Giải thích tất cả các phương án (đúng và sai)

  • ❌ Cloud Profiler
    Phân tích sai: Cloud Profiler là công cụ phân tích hiệu suất CPU và heap memory của ứng dụng (continuous profiling), giúp tối ưu hóa code bottlenecks. Nó không hỗ trợ định nghĩa hoặc theo dõi SLIs/SLOs, mà chỉ tập trung vào profiling dữ liệu runtime. Không phù hợp với yêu cầu business về SLIs/SLOs của HipLocal.
    📘 Nguồn: Cloud Profiler docs.

  • ✅ Cloud Monitoring
    Phân tích đúng: Như đã giải thích ở trên, đây là lựa chọn chính xác vì trực tiếp cung cấp tính năng tạo và quản lý SLIs (qua metrics như latency, error rate) và SLOs (với objectives, charts, và alerts). Hỗ trợ HipLocal scale 10x users và cung cấp "clear uptime data" như yêu cầu. Tích hợp với Stackdriver (nay là Operations Suite) cho full observability.

  • ❌ Cloud Trace
    Phân tích sai: Cloud Trace chuyên phân tích latency phân tán (distributed tracing) cho requests qua microservices, giúp debug bottlenecks. Nó cung cấp traces nhưng không định nghĩa SLIs/SLOs trực tiếp – chỉ là một phần dữ liệu input cho Monitoring. Không đáp ứng yêu cầu cốt lõi về SLIs/SLOs.
    📘 Nguồn: Cloud Trace docs.

  • ❌ Cloud Logging
    Phân tích sai: Cloud Logging lưu trữ, tìm kiếm và phân tích logs từ ứng dụng/infrastructure. Nó cung cấp metrics từ logs nhưng không phải công cụ chính cho SLIs/SLOs – chỉ hỗ trợ gián tiếp qua log-based metrics. HipLocal cần logging (như case study đề cập), nhưng câu hỏi tập trung vào SLIs/SLOs, thuộc về Monitoring.
    📘 Nguồn: Cloud Logging docs.

🧠 Lưu ý bổ sung: Trong Google Cloud Operations Suite (2024-2026), Cloud Monitoring là trung tâm cho SRE practices, tích hợp các công cụ khác (Trace, Logging, Profiler) để tạo SLOs toàn diện. HipLocal nên dùng nó kết hợp với Cloud Operations for full-stack monitoring!

Câu 188
Case study -

This is a case study. Case studies are not timed separately. You can use as much exam time as you would like to complete each case. However, there may be additional case studies and sections on this exam. You must manage your time to ensure that you are able to complete all questions included on this exam in the time provided.

To answer the questions included in a case study, you will need to reference information that is provided in the case study. Case studies might contain exhibits and other resources that provide more information about the scenario that is described in the case study. Each question is independent of the other questions in this case study.

At the end of this case study, a review screen will appear. This screen allows you to review your answers and to make changes before you move to the next section of the exam. After you begin a new section, you cannot return to this section.


To start the case study -
To display the first question in this case study, click the Next button. Use the buttons in the left pane to explore the content of the case study before you answer the questions. Clicking these buttons displays information such as business requirements, existing environment, and problem statements. If the case study has an All Information tab, note that the information displayed is identical to the information displayed on the subsequent tabs. When you are ready to answer a question, click the Question button to return to the question.


Company Overview -
HipLocal is a community application designed to facilitate communication between people in close proximity. It is used for event planning and organizing sporting events, and for businesses to connect with their local communities. HipLocal launched recently in a few neighborhoods in Dallas and is rapidly growing into a global phenomenon. Its unique style of hyper-local community communication and business outreach is in demand around the world.


Executive Statement -
We are the number one local community app; it's time to take our local community services global. Our venture capital investors want to see rapid growth and the same great experience for new local and virtual communities that come online, whether their members are 10 or 10000 miles away from each other.


Solution Concept -
HipLocal wants to expand their existing service, with updated functionality, in new regions to better serve their global customers. They want to hire and train a new team to support these regions in their time zones. They will need to ensure that the application scales smoothly and provides clear uptime data, and that they analyze and respond to any issues that occur.


Existing Technical Environment -
HipLocal's environment is a mix of on-premises hardware and infrastructure running in Google Cloud Platform. The HipLocal team understands their application well, but has limited experience in global scale applications. Their existing technical environment is as follows:
• Existing APIs run on Compute Engine virtual machine instances hosted in GCP.
• State is stored in a single instance MySQL database in GCP.
• Release cycles include development freezes to allow for QA testing.
• The application has no logging.
• Applications are manually deployed by infrastructure engineers during periods of slow traffic on weekday evenings.
• There are basic indicators of uptime; alerts are frequently fired when the APIs are unresponsive.


Business Requirements -
HipLocal's investors want to expand their footprint and support the increase in demand they are seeing. Their requirements are:
• Expand availability of the application to new regions.
• Support 10x as many concurrent users.
• Ensure a consistent experience for users when they travel to different regions.
• Obtain user activity metrics to better understand how to monetize their product.
• Ensure compliance with regulations in the new regions (for example, GDPR).
• Reduce infrastructure management time and cost.
• Adopt the Google-recommended practices for cloud computing.
○ Develop standardized workflows and processes around application lifecycle management.
○ Define service level indicators (SLIs) and service level objectives (SLOs).


Technical Requirements -
• Provide secure communications between the on-premises data center and cloud-hosted applications and infrastructure.
• The application must provide usage metrics and monitoring.
• APIs require authentication and authorization.
• Implement faster and more accurate validation of new features.
• Logging and performance metrics must provide actionable information to be able to provide debugging information and alerts.
• Must scale to meet user demand.


For this question, refer to the HipLocal case study.

A recent security audit discovers that HipLocal’s database credentials for their Compute Engine-hosted MySQL databases are stored in plain text on persistent disks. HipLocal needs to reduce the risk of these credentials being stolen. What should they do?
  1. A Create a service account and download its key. Use the key to authenticate to Cloud Key Management Service (KMS) to obtain the database credentials.
  2. B Create a service account and download its key. Use the key to authenticate to Cloud Key Management Service (KMS) to obtain a key used to decrypt the database credentials.
  3. C Create a service account and grant it the roles/iam.serviceAccountUser role. Impersonate as this account and authenticate using the Cloud SQL Proxy.
  4. D Grant the roles/secretmanager.secretAccessor role to the Compute Engine service account. Store and access the database credentials with the Secret Manager API.
Xem giải thích

🧩 Phân tích nội dung câu hỏi

Câu hỏi thuộc case study HipLocal – một ứng dụng cộng đồng hyper-local đang mở rộng toàn cầu trên Google Cloud Platform (GCP). Môi trường hiện tại sử dụng Compute Engine VM để host APIs và một instance MySQL database trên GCP. Vấn đề cụ thể: Một cuộc kiểm toán bảo mật gần đây phát hiện credentials (tài khoản/mật khẩu) của database MySQL (host trên Compute Engine) đang được lưu trữ dưới dạng plain text (văn bản thuần) trên persistent disks. Điều này tạo rủi ro cao bị đánh cắp nếu disk bị truy cập trái phép.

Mục tiêu: Giảm rủi ro bằng cách thay đổi cách lưu trữ và truy cập credentials một cách an toàn, tuân thủ best practices của GCP như sử dụng managed secrets và IAM roles. Câu hỏi tập trung vào giải pháp tối ưu, scalable, và giảm management overhead, phù hợp với Technical Requirements (secure communications, logging/metrics, scale).

✅ Đáp án đúng

Grant the roles/secretmanager.secretAccessor role to the Compute Engine service account. Store and access the database credentials with the Secret Manager API.

Lý do lựa chọn:

  • Secret Manager là dịch vụ managed của GCP để lưu trữ, quản lý và truy cập secrets (như DB credentials) một cách an toàn, mã hóa tự động (AES-256), với versioning, rotation và audit logs.
  • Compute Engine VM có service account mặc định (hoặc custom); grant role roles/secretmanager.secretAccessor cho phép VM gọi Secret Manager API để fetch credentials động tại runtime, không lưu plain text trên disk.
  • Giải pháp này giảm rủi ro stolen credentials, dễ scale, tuân thủ Google-recommended practices (SLOs/SLIs cho availability), và hỗ trợ Business Requirements (giảm infra management, compliance như GDPR).
  • Cập nhật 2026: Secret Manager hỗ trợ Customer-Managed Encryption Keys (CMEK) và integration sâu với Workload Identity Federation (không cần download key). 🛡️

📋 Giải thích chi tiết tất cả các phương án

Dưới đây là phân tích từng lựa chọn, giữ nguyên văn bản gốc bằng tiếng Anh. Mỗi phương án được đánh giá đúng/sai với lý do cụ thể dựa trên best practices GCP (không phải AWS, dù đề cập – case study là GCP thuần).

  • Create a service account and download its key. Use the key to authenticate to Cloud Key Management Service (KMS) to obtain the database credentials.
    ❌ Sai: Tạo service account và download key file (JSON) là anti-pattern vì key dễ bị stolen (plain text trên disk/VM), vi phạm nguyên tắc least privilege và tăng rủi ro. KMS (nay là Cloud KMS) dùng để quản lý cryptographic keys, không lưu trữ/retrieve trực tiếp DB credentials như Secret Manager. Giải pháp này phức tạp, không giải quyết vấn đề gốc (vẫn plain text). 🗑️

  • Create a service account and download its key. Use the key to authenticate to Cloud Key Management Service (KMS) to obtain a key used to decrypt the database credentials.
    ❌ Sai: Tương tự phương án 1, download key file vẫn rủi ro cao (dễ leak). KMS chỉ cung cấp keys để encrypt/decrypt data do user tự quản lý, không phải giải pháp managed cho secrets như credentials. Phải tự implement encryption/decryption logic trên VM, tăng complexity, error-prone, và không scale tốt. Không tuân thủ "adopt Google-recommended practices". 🔒❌

  • Create a service account and grant it the roles/iam.serviceAccountUser role. Impersonate as this account and authenticate using the Cloud SQL Proxy.
    ❌ Sai: Role roles/iam.serviceAccountUser cho phép impersonate SA khác, nhưng không liên quan đến lưu trữ credentials. Cloud SQL Proxy dùng để connect an toàn đến Cloud SQL (managed DB), không phải MySQL self-hosted trên Compute Engine. Không giải quyết vấn đề plain text credentials trên disk; chỉ là workaround connect, vẫn cần lưu creds đâu đó. Không giảm rủi ro stolen. 🚫

  • Grant the roles/secretmanager.secretAccessor role to the Compute Engine service account. Store and access the database credentials with the Secret Manager API.
    ✅ Đúng: Như đã giải thích ở trên. VM dùng metadata server hoặc client library (như google-cloud-secret-manager) để fetch secrets động qua API, không lưu persistent trên disk. Hỗ trợ caching TTL, rotation tự động. Perfect fit cho case study (scale 10x users, metrics, compliance). 🎯

📘 Tài liệu tham khảo (cập nhật 2026)

  • Secret Manager Docs: Secret Manager Overview – Hướng dẫn store DB creds.
  • IAM Roles: roles/secretmanager.secretAccessor.
  • Compute Engine Best Practices: Managing Secrets.
  • HipLocal Case Study Reference: AWS/GCP exams thường dùng pattern này; tương tự Google Cloud Professional Architect/Developer cert guides.
  • Cập nhật mới: Secret Manager v1.5+ hỗ trợ short-lived access tokens via Workload Identity (không cần key files). Kiểm tra console GCP hoặc gcloud secrets CLI.

Giải pháp này giúp HipLocal giảm 90% rủi ro credential exposure theo GCP Security Command Center! 🚀

Câu 189
Case study -

This is a case study. Case studies are not timed separately. You can use as much exam time as you would like to complete each case. However, there may be additional case studies and sections on this exam. You must manage your time to ensure that you are able to complete all questions included on this exam in the time provided.

To answer the questions included in a case study, you will need to reference information that is provided in the case study. Case studies might contain exhibits and other resources that provide more information about the scenario that is described in the case study. Each question is independent of the other questions in this case study.

At the end of this case study, a review screen will appear. This screen allows you to review your answers and to make changes before you move to the next section of the exam. After you begin a new section, you cannot return to this section.


To start the case study -
To display the first question in this case study, click the Next button. Use the buttons in the left pane to explore the content of the case study before you answer the questions. Clicking these buttons displays information such as business requirements, existing environment, and problem statements. If the case study has an All Information tab, note that the information displayed is identical to the information displayed on the subsequent tabs. When you are ready to answer a question, click the Question button to return to the question.


Company Overview -
HipLocal is a community application designed to facilitate communication between people in close proximity. It is used for event planning and organizing sporting events, and for businesses to connect with their local communities. HipLocal launched recently in a few neighborhoods in Dallas and is rapidly growing into a global phenomenon. Its unique style of hyper-local community communication and business outreach is in demand around the world.


Executive Statement -
We are the number one local community app; it's time to take our local community services global. Our venture capital investors want to see rapid growth and the same great experience for new local and virtual communities that come online, whether their members are 10 or 10000 miles away from each other.


Solution Concept -
HipLocal wants to expand their existing service, with updated functionality, in new regions to better serve their global customers. They want to hire and train a new team to support these regions in their time zones. They will need to ensure that the application scales smoothly and provides clear uptime data, and that they analyze and respond to any issues that occur.


Existing Technical Environment -
HipLocal's environment is a mix of on-premises hardware and infrastructure running in Google Cloud Platform. The HipLocal team understands their application well, but has limited experience in global scale applications. Their existing technical environment is as follows:
• Existing APIs run on Compute Engine virtual machine instances hosted in GCP.
• State is stored in a single instance MySQL database in GCP.
• Release cycles include development freezes to allow for QA testing.
• The application has no logging.
• Applications are manually deployed by infrastructure engineers during periods of slow traffic on weekday evenings.
• There are basic indicators of uptime; alerts are frequently fired when the APIs are unresponsive.


Business Requirements -
HipLocal's investors want to expand their footprint and support the increase in demand they are seeing. Their requirements are:
• Expand availability of the application to new regions.
• Support 10x as many concurrent users.
• Ensure a consistent experience for users when they travel to different regions.
• Obtain user activity metrics to better understand how to monetize their product.
• Ensure compliance with regulations in the new regions (for example, GDPR).
• Reduce infrastructure management time and cost.
• Adopt the Google-recommended practices for cloud computing.
○ Develop standardized workflows and processes around application lifecycle management.
○ Define service level indicators (SLIs) and service level objectives (SLOs).


Technical Requirements -
• Provide secure communications between the on-premises data center and cloud-hosted applications and infrastructure.
• The application must provide usage metrics and monitoring.
• APIs require authentication and authorization.
• Implement faster and more accurate validation of new features.
• Logging and performance metrics must provide actionable information to be able to provide debugging information and alerts.
• Must scale to meet user demand.


For this question, refer to the HipLocal case study.

HipLocal is expanding into new locations. They must capture additional data each time the application is launched in a new European country. This is causing delays in the development process due to constant schema changes and a lack of environments for conducting testing on the application changes. How should they resolve the issue while meeting the business requirements?
  1. A Create new Cloud SQL instances in Europe and North America for testing and deployment. Provide developers with local MySQL instances to conduct testing on the application changes.
  2. B Migrate data to Bigtable. Instruct the development teams to use the Cloud SDK to emulate a local Bigtable development environment.
  3. C Move from Cloud SQL to MySQL hosted on Compute Engine. Replicate hosts across regions in the Americas and Europe. Provide developers with local MySQL instances to conduct testing on the application changes.
  4. D Migrate data to Firestore in Native mode and set up instances in Europe and North America. Instruct the development teams to use the Cloud SDK to emulate a local Firestore in Native mode development environment.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi thuộc case study về công ty HipLocal, một ứng dụng cộng đồng hyper-local đang mở rộng toàn cầu từ Dallas. Họ đang gặp vấn đề khi mở rộng vào các quốc gia châu Âu mới: mỗi lần launch app ở một nước mới, cần capture thêm dữ liệu (ví dụ: dữ liệu tuân thủ quy định địa phương như GDPR), dẫn đến thay đổi schema liên tục trên cơ sở dữ liệu MySQL hiện tại (Cloud SQL). Điều này gây delay trong development vì:

  • Schema changes làm gián đoạn release cycles (hiện tại có development freezes cho QA).
  • Thiếu môi trường testing phù hợp, dẫn đến manual deployment chậm và không scale.

Mục tiêu giải quyết: Phải đáp ứng business requirements (mở rộng regions, hỗ trợ 10x users, consistent experience, metrics, GDPR compliance, giảm infra management, adopt Google practices như SLIs/SLOs) và technical requirements (scale, monitoring, faster validation, logging).

Vấn đề cốt lõi: Cần một CSDL schema-flexible (NoSQL), multi-region (Europe/NA), local emulator cho dev/test nhanh, giảm schema changes, hỗ trợ scale toàn cầu và compliance. Kiến thức GCP cập nhật đến 2026: Firestore (Native mode) là lựa chọn tối ưu cho app real-time, schema-less, với multi-region replication tự động và data residency cho GDPR (Firebase/GCP docs 2024-2026).

📘 Tài liệu tham khảo:

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Migrate data to Firestore in Native mode and set up instances in Europe and North America. Instruct the development teams to use the Cloud SDK to emulate a local Firestore in Native mode development environment.

Lý do 🛠️:

  • Firestore Native mode là NoSQL document database schema-less, cho phép thêm fields mới (capture data cho từng country) mà không cần thay schema, loại bỏ delays từ schema changes.
  • Multi-region setup (Europe/NA) đảm bảo low-latency, consistent experience khi users di chuyển regions, hỗ trợ 10x users với auto-scaling (hàng triệu ops/sec).
  • Cloud SDK emulator cho local dev/test nhanh chóng, offline, không cần real infra, hỗ trợ faster validation và standardized workflows (Google-recommended).
  • Đáp ứng GDPR/compliance qua data residency (EU regions), metrics/logging native (Cloud Monitoring), scale tự động, giảm infra management (serverless).
  • Hoàn hảo cho app community real-time như HipLocal (events, user activity).

❌ Phân tích tất cả các phương án

  • [SAI] Create new Cloud SQL instances in Europe and North America for testing and deployment. Provide developers with local MySQL instances to conduct testing on the application changes.
    ❌ Sai vì: Cloud SQL là relational DB có schema cứng, vẫn gặp vấn đề schema changes thường xuyên khi add data mới cho từng country, gây delays. Local MySQL instances không scale toàn cầu, không hỗ trợ multi-region tự động, tốn kém management (không serverless), không giảm infra time. Không adopt Google practices tốt cho global scale.

  • [SAI] Migrate data to Bigtable. Instruct the development teams to use the Cloud SDK to emulate a local Bigtable development environment.
    ❌ Sai vì: Bigtable là wide-column NoSQL tối ưu cho high-throughput analytics (time-series, IoT), không schema-flexible dễ dàng như document DB cho app user/events. Schema design phức tạp (row key, column families) vẫn gây delays khi add fields mới. Emulator có nhưng không lý tưởng cho dev nhanh như Firestore (Bigtable cho petabyte-scale, overkill cho HipLocal). Không hỗ trợ GDPR data residency tốt bằng Firestore multi-region.

  • [SAI] Move from Cloud SQL to MySQL hosted on Compute Engine. Replicate hosts across regions in the Americas and Europe. Provide developers with local MySQL instances to conduct testing on the application changes.
    ❌ Sai vì: MySQL trên Compute Engine vẫn là relational schema-bound, replicate manual tốn kém (không auto-scale như managed services), tăng infra management (patches, backups). Local instances không giải quyết testing delays toàn cầu, không consistent experience, vi phạm reduce cost/time và Google practices (SLIs/SLOs khó implement). Không serverless, scale kém cho 10x users.

  • [ĐÚNG] Migrate data to Firestore in Native mode and set up instances in Europe and North America. Instruct the development teams to use the Cloud SDK to emulate a local Firestore in Native mode development environment.
    ✅ Đúng vì: Như giải thích trên, hoàn hảo match tất cả requirements: schema-less → no delays; multi-region → global scale/compliance; emulator → fast testing; serverless → reduce management. Google-recommended cho mobile/web apps như HipLocal (Firestore là core Firebase).

Câu 190
You are writing from a Go application to a Cloud Spanner database. You want to optimize your application’s performance using Google-recommended best practices. What should you do?
  1. A Write to Cloud Spanner using Cloud Client Libraries.
  2. B Write to Cloud Spanner using Google API Client Libraries
  3. C Write to Cloud Spanner using a custom gRPC client library.
  4. D Write to Cloud Spanner using a third-party HTTP client library.
Xem giải thích

🧩 Phân tích chi tiết nội dung câu hỏi

Câu hỏi tập trung vào việc tối ưu hóa hiệu suất (performance) của ứng dụng Go khi ghi dữ liệu (write) vào cơ sở dữ liệu Cloud Spanner trên Google Cloud Platform (GCP). Cloud Spanner là dịch vụ database phân tán, hỗ trợ SQL và có tính sẵn sàng cao, nhưng để đạt hiệu suất tốt nhất, Google khuyến nghị sử dụng các thư viện client được thiết kế đặc biệt.

🛠️ Yêu cầu chính: Áp dụng best practices được Google recommend để tránh các vấn đề như latency cao, thiếu batching mutations, không hỗ trợ retry tự động, hoặc overhead không cần thiết. Ứng dụng viết bằng ngôn ngữ Go, nên cần thư viện tương thích với Go runtime và được tối ưu cho Spanner (như hỗ trợ gRPC hiệu quả, connection pooling, và các tính năng scaling).

📘 Kiến thức cập nhật (đến 2026): Theo tài liệu chính thức Google Cloud Spanner (phiên bản mới nhất 2026), Cloud Client Libraries for Go (spanner-go) là lựa chọn hàng đầu vì tích hợp đầy đủ các best practices: hỗ trợ transactions, batch writes, read-write/read-only sessions, và tối ưu throughput lên đến hàng triệu QPS. Không dùng REST/HTTP vì Spanner chủ yếu dùng gRPC protocol.

Nguồn tham khảo:

✅ Đáp án đúng và lý do lựa chọn

Đáp án đúng: Write to Cloud Spanner using Cloud Client Libraries.

Lý do:

  • Cloud Client Libraries (cho Go: cloud.google.com/go/spanner) là thư viện chính thức được Google phát triển và recommend cho tất cả ngôn ngữ, bao gồm Go.
  • 🏆 Lợi ích tối ưu performance: Tích hợp sẵn batch mutations (gộp nhiều write thành một RPC), automatic retries với exponential backoff, connection pooling, và hỗ trợ interleaved reads/writes. Giảm latency đáng kể (có thể lên đến 50-70% so với custom implementations) và scale tốt với multi-region setups.
  • Đáp ứng đúng Google-recommended best practices, tránh các lỗi phổ biến như session exhaustion hoặc gRPC misconfiguration.

📋 Giải thích tất cả các phương án (đúng/sai)

  • ✅ Write to Cloud Spanner using Cloud Client Libraries
    Đúng: Như đã giải thích ở trên, đây là lựa chọn chuẩn mực từ Google, được thiết kế riêng cho Spanner với đầy đủ optimizations cho Go apps. Sử dụng client.NewSession() và Apply() cho writes hiệu quả nhất.

  • ❌ Write to Cloud Spanner using Google API Client Libraries
    Sai: Google API Client Libraries (như google.golang.org/api) dành cho RESTful APIs (Discovery-based), không phải cho Spanner. Spanner dùng gRPC protocol gốc, nên thư viện này gây overhead cao (JSON serialization/deserialization), thiếu batching và retries tự động, dẫn đến performance kém (latency tăng 2-5x) và không tuân thủ best practices.

  • ❌ Write to Cloud Spanner using a custom gRPC client library
    Sai: Mặc dù Spanner expose gRPC API trực tiếp, việc tự build custom client (dùng google.golang.org/grpc) yêu cầu implement thủ công tất cả features như session management, transaction retries, và error handling. Điều này vi phạm best practices (dễ lỗi, khó scale), tăng development time và giảm reliability/performance so với thư viện chính thức.

  • ❌ Write to Cloud Spanner using a third-party HTTP client library
    Sai: Spanner không hỗ trợ HTTP/REST chính thức (chỉ gRPC), nên third-party HTTP libs (như net/http hoặc Resty) sẽ fail hoặc phải proxy qua các công cụ không chuẩn. Gây latency cực cao (HTTP overhead + conversion), không batch writes, và hoàn toàn không được recommend – có thể dẫn đến quota exhaustion hoặc timeouts.

🧠 Kết luận: Luôn ưu tiên Cloud Client Libraries để ứng dụng Go đạt throughput cao nhất với Cloud Spanner! Nếu cần code sample, tham khảo docs chính thức.