Ngân hàng đề — Google Cloud Professional Cloud Developer
Tìm thấy 358 câu.
- A Employ Cloud Composer to manage the image processing workflows. Use Dataproc for workflow monitoring and analytics.
- B Use Cloud Run to deploy the image processing functions. Use Apigee to expose the API. Use Cloud Logging for workflow monitoring.
- C Implement Workflows to orchestrate the image processing tasks. Use Cloud Logging for workflow monitoring.
- D Use Cloud Build to trigger Cloud Functions for the image processing tasks. Use Cloud Monitoring for workflow monitoring.
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 phát triển một ứng dụng xử lý hình ảnh mới trên Google Cloud Platform (GCP), với các nhiệm vụ cụ thể như thay đổi kích thước (resizing), cắt (cropping), và thêm watermark lên hình ảnh. Ứng dụng cần:
- Xử lý các workflow phức tạp bao gồm nhiều bước liên tiếp.
- Giám sát workflow để theo dõi tiến trình.
- Tự động scale hiệu quả khi có lượng hình ảnh lớn (high volume).
- Tối ưu hóa nỗ lực triển khai (least effort), nghĩa là chọn giải pháp serverless, dễ quản lý, không cần cấu hình phức tạp.
Mục tiêu chính là tự động hóa toàn bộ quy trình xử lý và giám sát với chi phí vận hành thấp, tận dụng các dịch vụ GCP native để tránh custom code nhiều. Đây là kịch bản điển hình cho serverless workflow orchestration trên GCP, phù hợp với kiến thức cập nhật đến năm 2026 (phiên bản Workflows v2 với tích hợp sâu hơn Cloud Functions/Run và Logging/Monitoring).
📘 Tài liệu tham khảo:
- Google Cloud Workflows Documentation (cập nhật 2025: hỗ trợ step sequencing, error handling tự động).
- Cloud Logging for Workflows (tích hợp native logging/auditing).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Implement Workflows to orchestrate the image processing tasks. Use Cloud Logging for workflow monitoring.
Lý do chi tiết 🛠️:
- Cloud Workflows là dịch vụ serverless orchestration chuyên dụng để phối hợp các task (như gọi Cloud Functions cho resize/crop/watermark), hỗ trợ YAML-based workflow definition đơn giản, tự động retry/error handling, và scale vô hạn mà không cần quản lý infrastructure – hoàn hảo cho "least effort".
- Cloud Logging tích hợp native với Workflows để giám sát real-time (logs, metrics, traces), dễ query và alert mà không cần setup thêm.
- Giải pháp này tối ưu nhất cho image processing pipeline, tiết kiệm thời gian so với các công cụ phức tạp hơn như Composer.
📋 Giải thích tất cả các phương án (đúng/sai)
-
[SAI] Employ Cloud Composer to manage the image processing workflows. Use Dataproc for workflow monitoring and analytics.
❌ Sai vì: Cloud Composer (dựa trên Apache Airflow) phù hợp cho DAG phức tạp, data-heavy ETL, nhưng overkill (cần cluster quản lý, chi phí cao, effort lớn) cho simple image tasks. Dataproc (Hadoop/Spark) dành cho big data analytics, không phải monitoring workflow – không scale "least effort" và không native cho image processing. -
[SAI] Use Cloud Run to deploy the image processing functions. Use Apigee to expose the API. Use Cloud Logging for workflow monitoring.
❌ Sai vì: Cloud Run tốt cho containerized functions, nhưng không orchestrate workflow (phải tự code sequencing). Apigee là API management gateway, thừa thãi cho internal processing (chỉ cần nếu public API). Logging tốt nhưng thiếu orchestration – không automate full workflow, effort cao hơn Workflows. -
[ĐÚNG] Implement Workflows to orchestrate the image processing tasks. Use Cloud Logging for workflow monitoring.
✅ Đúng vì: Như đã giải thích ở trên, Workflows lý tưởng cho orchestration serverless (gọi sequential tasks như ImageMagick via Functions), scale auto với volume lớn, và Logging native cho monitoring chi tiết (execution history, failures). Least effort: chỉ define YAML, deploy ngay! (Cập nhật 2026: hỗ trợ subworkflows cho complex image pipelines). -
[SAI] Use Cloud Build to trigger Cloud Functions for the image processing tasks. Use Cloud Monitoring for workflow monitoring.
❌ Sai vì: Cloud Build dành cho CI/CD pipelines (build/deploy code), không phải ongoing image processing workflows – trigger không linh hoạt cho high-volume. Cloud Monitoring tốt cho metrics/alerts, nhưng không chuyên sâu logs workflow như Logging, và thiếu orchestration native – effort cao, không scale realtime.
Tóm lại, Workflows + Logging là combo optimal, serverless-first cho kịch bản này trên GCP! 🚀
- A Enable Identity-Aware Proxy (IAP) for all microservices. Develop a new microservice that checks the authentication requirements for each application and controls access to the respective services.
- B Enable Identity-Aware Proxy (IAP) for all microservices. Manage access control lists (ACLs) for the restricted services, and configure allAuthenticatedUsers access to the public services.
- C Use Cloud Endpoints with Firebase Authentication for all microservices. Configure Firebase rules to manage access control lists (ACLs) for each service, allowing access to the public services.
- D Configure separate Cloud Run services for the public and restricted microservices. Enable Identity-Aware Proxy (IAP) only for the restricted services, and configure the Cloud Run ingress settings to ‘Internal and Cloud Load Balancing’.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi xoay quanh việc phát triển một ứng dụng web đa microservices triển khai trên Cloud Run (dịch vụ serverless container của Google Cloud). Ứng dụng có hai loại microservices:
- Public microservices: Có thể truy cập công khai mà không cần xác thực.
- Restricted microservices: Chỉ cho phép truy cập sau khi xác thực bằng Google identities (như Google OAuth).
Mục tiêu:
- Đảm bảo bảo mật cao nhất cho restricted services.
- Cho phép truy cập tự do cho public services.
- Sử dụng cách tiếp cận an toàn nhất, giảm thiểu overhead quản lý và độ phức tạp (theo best practices GCP mới nhất đến 2026).
Vấn đề cốt lõi: Cấu hình truy cập sao cho IAP (Identity-Aware Proxy) chỉ áp dụng cho phần cần thiết, tránh bảo vệ thừa gây phức tạp. Cloud Run hỗ trợ ingress settings để kiểm soát traffic (all, internal, internal+CLB).
📘 Tài liệu tham khảo:
- Cloud Run Documentation: Ingress settings (cập nhật 2025).
- Identity-Aware Proxy for Cloud Run (best practices 2026).
- Cloud Run Security Best Practices.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng:
- Configure separate Cloud Run services for the public and restricted microservices. Enable Identity-Aware Proxy (IAP) only for the restricted services, and configure the Cloud Run ingress settings to ‘Internal and Cloud Load Balancing’.
Lý do chọn đáp án này 🛡️:
- Tách riêng Cloud Run services cho public và restricted giúp quản lý độc lập, dễ scale và bảo mật (best practice GCP).
- IAP chỉ enable cho restricted services: IAP tích hợp IAM, xác thực Google identities mà không cần code thêm, giảm overhead. Public services không cần IAP nên truy cập tự do.
- Ingress settings ‘Internal and Cloud Load Balancing’: Giới hạn traffic chỉ từ internal GCP network hoặc qua Cloud Load Balancer (CLB), kết hợp IAP ngăn chặn truy cập public trực tiếp, tăng bảo mật mà không phức tạp.
- Phù hợp zero-trust model GCP 2026, minimize management (không cần ACL phức tạp hay service mới).
📋 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 kiến thức GCP mới nhất.
-
[SAI] Enable Identity-Aware Proxy (IAP) for all microservices. Develop a new microservice that checks the authentication requirements for each application and controls access to the respective services.
❌ Sai vì: Enable IAP cho tất cả services sẽ buộc xác thực ngay cả public services, vi phạm yêu cầu "unrestricted access". Phát triển microservice mới để check auth tạo overhead cao (code custom, maintain, scale riêng), phức tạp hóa architecture thay vì dùng native IAP. Không phải best practice GCP (tăng management overhead). -
[SAI] Enable Identity-Aware Proxy (IAP) for all microservices. Manage access control lists (ACLs) for the restricted services, and configure allAuthenticatedUsers access to the public services.
❌ Sai vì: IAP enable cho tất cả vẫn yêu cầu auth bắt buộc cho mọi request (không bypass được dễ dàng), làm public services không "unrestricted". Quản lý ACLs (IAM policies) cho restricted phức tạp, scale kém với microservices nhiều.allAuthenticatedUserschỉ cho user đã login Google, không phải public thực sự. Overhead cao, không secure/minimal như yêu cầu. -
[SAI] Use Cloud Endpoints with Firebase Authentication for all microservices. Configure Firebase rules to manage access control lists (ACLs) for each service, allowing access to the public services.
❌ Sai vì: Cloud Endpoints deprecated từ 2024 (GCP khuyến nghị Extensible Service Proxy v2 hoặc native IAP thay thế đến 2026). Firebase Auth + rules phù hợp Firebase ecosystem nhưng không native cho Cloud Run, tăng complexity (setup API gateway, sync rules). Áp dụng cho tất cả services vẫn không tách biệt public/restricted tốt, overhead quản lý ACLs cao. Không phải "most secure" cho Google identities trên Cloud Run. -
[ĐÚNG] Configure separate Cloud Run services for the public and restricted microservices. Enable Identity-Aware Proxy (IAP) only for the restricted services, and configure the Cloud Run ingress settings to ‘Internal and Cloud Load Balancing’.
✅ Đúng vì: Như giải thích ở trên – tách services độc lập, IAP selective, ingress restrict traffic internal/CLB đảm bảo secure nhất (zero public exposure cho restricted), minimal overhead (native GCP, no custom code). Hoàn hảo cho multi-microservices trên Cloud Run 2026! 🚀
Which rollout strategy should you use?
- A Migrate the traffic to the new service by setting Cloud Run’s traffic split based on the percentage of registered customers.
- B Migrate the traffic to the new service by using a blue/green deployment approach.
- C Migrate the traffic to the new service by using a feature flag for registered customers.
- D Migrate the traffic to the new service and enable session affinity for Cloud Run.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi xoay quanh việc triển khai một API tính toán rủi ro tài chính được xây dựng trên Cloud Run với giao diện gRPC. Bạn là lead developer thường xuyên tối ưu hóa các công cụ tính rủi ro (risk calculators). Mục tiêu là kích hoạt các tối ưu hóa này chỉ cho một nhóm khách hàng đã đăng ký thử nghiệm (select customers) trước khi triển khai rộng rãi cho tất cả. Pipeline CI/CD đã build image mới và lưu vào Artifact Registry.
📌 Vấn đề cốt lõi: Cần một rollout strategy để migrate traffic sang service mới một cách an toàn, chính xác dựa trên danh sách khách hàng đăng ký, không phải ngẫu nhiên hay toàn bộ traffic. Cloud Run hỗ trợ các cơ chế rollout như traffic splitting giữa revisions, nhưng phải phù hợp với yêu cầu per-customer (theo phiên bản Cloud Run mới nhất đến 2026, hỗ trợ revisions, traffic management, và tích hợp feature flags qua các công cụ như Firebase Remote Config hoặc third-party như LaunchDarkly).
🛠️ Bối cảnh GCP: Cloud Run là serverless container platform, deploy revisions mới từ Artifact Registry. Rollout có thể gradual qua traffic percentage/tags, nhưng feature control per-user cần cơ chế toggle động.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Migrate the traffic to the new service by using a feature flag for registered customers.
Lý do chi tiết 🎯:
- Feature flag (cờ tính năng) là cách lý tưởng để toggle tính năng động dựa trên user/customer cụ thể (ví dụ: kiểm tra ID khách hàng đã đăng ký trong database hoặc config service như Firebase Remote Config, hoặc tích hợp với LaunchDarkly hỗ trợ GCP).
- Migrate traffic sang revision mới (deploy image từ Artifact Registry), sau đó dùng feature flag để chỉ enable optimization cho registered customers mà không ảnh hưởng người khác – ngay cả khi họ hit revision mới.
- Điều này cho phép A/B testing per-user, monitor, và rollback dễ dàng mà không cần traffic split phức tạp. Phù hợp với best practices GCP cho progressive delivery (theo Cloud Run docs 2026: hỗ trợ server-side feature flags qua metadata hoặc SDK).
- Ưu điểm: ✅ Zero-downtime, granular control, dễ audit/rollback cho financial API nhạy cảm.
📘 Tài liệu tham khảo:
- Cloud Run: Traffic migration & rollouts (cập nhật 2025-2026).
- GCP Feature Flags best practices với ví dụ tích hợp Firebase/LaunchDarkly.
❌ Giải thích tất cả các phương án (đúng/sai)
-
Phương án SAI: Migrate the traffic to the new service by setting Cloud Run’s traffic split based on the percentage of registered customers.
Lý do sai 🚫: Traffic split của Cloud Run chỉ hỗ trợ phân bổ theo % ngẫu nhiên hoặc tags trên revisions (ví dụ: 10% traffic sang revision mới), không thể target chính xác dựa trên % registered customers (vì không biết tỷ lệ khách hàng cụ thể trong traffic). Dẫn đến một số registered customers vẫn dùng old version, hoặc non-registered dùng new – không kiểm soát được. Không phù hợp per-user selection. -
Phương án SAI: Migrate the traffic to the new service by using a blue/green deployment approach.
Lý do sai 🚫: Blue/green trong Cloud Run (qua revisions và manual traffic switch 100%) chỉ switch toàn bộ traffic từ blue (old) sang green (new), không hỗ trợ select customers. Sau switch, tất cả đều dùng new version – trái với yêu cầu thử nghiệm dần dần cho registered users. Phù hợp cho zero-downtime all-traffic, nhưng thiếu granularity. -
Phương án ĐÚNG: Migrate the traffic to the new service by using a feature flag for registered customers.
Lý do đúng 🎯 (như phần trên): Cho phép deploy new revision, migrate traffic, rồi toggle feature chỉ cho registered customers (check via user ID/session). Linh hoạt, an toàn cho optimizations thường xuyên. Hỗ trợ monitoring qua Cloud Monitoring/Logging. -
Phương án SAI: Migrate the traffic to the new service and enable session affinity for Cloud Run.
Lý do sai 🚫: Session affinity (sticky sessions) chỉ đảm bảo request từ cùng session/user stick vào cùng instance/revision, giúp consistency trong gRPC calls. Nhưng không chọn lọc traffic per registered customers – tất cả traffic migrate đều áp dụng affinity, không phân biệt user groups. Useless cho rollout selective.
🧠 Kết luận: Feature flag là 🛡️ chiến lược tốt nhất cho canary/release progressive per-user trong GCP Cloud Run, đặc biệt với API financial cần compliance cao (như PCI-DSS). Nếu cần code sample, có thể dùng @google-cloud/remote-config hoặc SDK LaunchDarkly!
- A Use Apigee to expose your API. Use Memorystore for Redis to cache frequently accessed data. Implement exponential backoff in the application to retry failed requests.
- B Use Apigee to expose your API. Implement rate limiting and access control policies in Apigee to control API traffic. Use Pub/Sub to queue requests to prevent database overload.
- C Use Cloud Load Balancing to expose your API. Use Cloud CDN in front of the load balancer to cache responses. Implement exponential backoff to retry failed requests.
- D Use Cloud Load Balancing to expose your API. Increase the memory for the database instances to handle more concurrent requests. Implement a custom rate-limiting mechanism in your application code to control API requests.
Xem giải thích
🧩 Giải thích chi tiết nội dung câu hỏi
Câu hỏi mô tả một ứng dụng thương mại điện tử (ecommerce) đang phát triển nhanh chóng về số lượng người dùng, dẫn đến vấn đề hiệu suất do lượng yêu cầu lớn đến backend API (do đội ngũ tự phát triển và quản lý). Cơ sở dữ liệu Cloud SQL đang bị quá tải, gây ra độ trễ (latency) và thời gian chờ hết hạn (timeouts). Nhiệm vụ là triển khai giải pháp tối ưu hóa hiệu suất API và cải thiện trải nghiệm người dùng (UX).
Vấn đề cốt lõi:
- Quá tải database từ các truy vấn lặp lại.
- Cần giải pháp giảm tải DB, quản lý traffic API, và xử lý lỗi graceful mà không làm phức tạp hệ thống.
- Tập trung vào các dịch vụ Google Cloud như Apigee (API management), Memorystore (caching), Pub/Sub (messaging), Load Balancing, CDN, v.v. (dựa trên kiến thức GCP cập nhật đến 2026, với Cloud SQL hỗ trợ auto-scaling nhưng vẫn cần caching để tối ưu).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Use Apigee to expose your API. Use Memorystore for Redis to cache frequently accessed data. Implement exponential backoff in the application to retry failed requests.
Lý do chọn đáp án này 🛠️:
- Apigee là nền tảng quản lý API chuyên dụng của Google Cloud (cập nhật 2026: hỗ trợ hybrid/multi-cloud, analytics sâu, security policies), giúp expose API an toàn, monitor traffic, và tích hợp caching/quota – giảm tải trực tiếp cho backend.
- Memorystore for Redis là dịch vụ caching managed (fully managed Redis 7.x+), lý tưởng để cache dữ liệu truy cập thường xuyên (như sản phẩm, giỏ hàng), giảm 80-90% truy vấn Cloud SQL theo best practices GCP, cải thiện latency xuống sub-10ms.
- Exponential backoff là kỹ thuật retry chuẩn (tăng dần delay giữa các lần thử), giúp ứng dụng xử lý lỗi DB overload mà không làm tình hình tệ hơn (theo Google Cloud Well-Architected Framework 2026).
- Toàn diện: Giải quyết gốc rễ (cache DB), quản lý API, và resilience – phù hợp cho ecommerce scale nhanh.
📋 Phân tích tất cả các phương án
Dưới đây là phân tích chi tiết từng lựa chọn, với ✅ đúng và ❌ sai, dựa trên kiến thức GCP mới nhất (2026: Apigee Sense, Memorystore auto-scaling, Cloud SQL v2 với read replicas).
-
✅ Use Apigee to expose your API. Use Memorystore for Redis to cache frequently accessed data. Implement exponential backoff in the application to retry failed requests.
🟢 Đúng vì: Kết hợp hoàn hảo – Apigee quản lý API traffic, Redis cache dữ liệu nóng (giảm load Cloud SQL hiệu quả nhất), backoff retry graceful. Giải pháp scalable, managed, không cần code phức tạp. -
❌ Use Apigee to expose your API. Implement rate limiting and access control policies in Apigee to control API traffic. Use Pub/Sub to queue requests to prevent database overload.
🔴 Sai vì: Apigee rate limiting tốt (quota/spike arrest), nhưng Pub/Sub là pub/sub messaging (không phải queue trực tiếp cho API sync requests). Queue requests sẽ làm phức tạp flow (cần pull subscribers), tăng latency thay vì giảm, không giải quyết cache DB gốc rễ (Pub/Sub Lite/Standard chỉ async decoupling, không cache). -
❌ Use Cloud Load Balancing to expose your API. Use Cloud CDN in front of the load balancer to cache responses. Implement exponential backoff to retry failed requests.
🔴 Sai vì: Cloud Load Balancing (Global/Regional HTTP(S)) phù hợp compute services (GCE/GKE), nhưng không phải API management chuyên sâu như Apigee (thiếu analytics/security). Cloud CDN cache HTTP responses (tốt cho static/API idempotent), nhưng không cache DB queries trực tiếp, vẫn overload Cloud SQL nếu data dynamic/hot (CDN key-based, không semantic cache như Redis). -
❌ Use Cloud Load Balancing to expose your API. Increase the memory for the database instances to handle more concurrent requests. Implement a custom rate-limiting mechanism in your application code to control API requests.
🔴 Sai vì: Tăng memory Cloud SQL là vertical scaling (có limits: max 96 vCPU/Cloud SQL Enterprise 2026), không bền vững cho traffic spike (không auto-scale tốt như horizontal). Custom rate-limiting in app code kém hiệu quả (per-instance, stateful, khó scale), dễ bottleneck so với Apigee managed policies.
📘 Tài liệu tham khảo
- Google Cloud Documentation (2026): Apigee Overview, Memorystore for Redis Best Practices, Cloud SQL Performance Tuning.
- Well-Architected Framework: Reliability Pillar – nhấn mạnh caching + backoff.
- Case Study: GCP Ecommerce blueprints (cache Redis giảm 70% DB load).
Giải pháp đúng giúp hệ thống scale horizontally bền vững! 🚀
- A Configure the application’s frontend load balancer to toggle between the new and old revisions.
- B Configure the application code to send a small percentage of users to the newly deployed revision.
- C Deploy the feature with “Serve this revision immediately” unchecked, and configure the new revision to serve a small percentage of traffic. Check for errors, and increase traffic to the revision as appropriate.
- D Deploy the feature with “Serve this revision immediately” checked. Check for errors, roll back to the previous revision, and repeat the process until you have verified that the deployment is bug-free.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi tập trung vào việc triển khai một tính năng mới vào môi trường production trên Google Cloud Run (một dịch vụ serverless container của Google Cloud Platform - GCP). Yêu cầu chính là thực hiện triển khai dần dần (gradual deployment) để tránh downtime lớn do lỗi code, theo quy định của đội SRE (Site Reliability Engineering). Mục tiêu là cấu hình với nỗ lực tối thiểu (minimal effort).
🛠️ Bối cảnh kỹ thuật: Cloud Run hỗ trợ revision-based deployment, nơi mỗi lần deploy tạo ra một revision mới. Bạn có thể phân bổ traffic giữa các revision cũ/mới thông qua traffic splitting. Điều này cho phép kiểm tra dần dần mà không ảnh hưởng toàn bộ hệ thống, phù hợp với best practice zero-downtime deployment. Kiến thức dựa trên tài liệu GCP cập nhật mới nhất (tính đến 2026, phiên bản Cloud Run stable channel).
📘 Tài liệu tham khảo:
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Deploy the feature with “Serve this revision immediately” unchecked, and configure the new revision to serve a small percentage of traffic. Check for errors, and increase traffic to the revision as appropriate.
Lý do:
- Đây là cách tối ưu và minimal effort trên Cloud Run để thực hiện gradual deployment. Khi uncheck "Serve this revision immediately" (trong gcloud hoặc Console), revision mới sẽ nhận 0% traffic ban đầu. Sau đó, dùng lệnh
gcloud run services update-traffichoặc Console để assign phần trăm traffic nhỏ (ví dụ: 10%) cho revision mới. - ✅ Kiểm tra lỗi qua logs/metrics (Cloud Monitoring/Logging), sau đó tăng dần traffic (ví dụ: 20%, 50%, 100%) nếu ổn. Điều này tuân thủ SRE mandate, tránh downtime lớn, và tự động hóa cao (không cần code thay đổi).
- Phù hợp best practice GCP 2026: Hỗ trợ blue-green/canary deployments native mà không cần tool ngoài.
❌ Giải thích tất cả các phương án
Dưới đây là phân tích chi tiết 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 dựa trên tính khả thi, minimal effort và phù hợp với Cloud Run.
-
Configure the application’s frontend load balancer to toggle between the new and old revisions.
❌ Sai: Cloud Run không sử dụng frontend load balancer truyền thống như GCLB (Global Load Balancer). Traffic management được xử lý native qua revisions trong service, không cần config load balancer riêng. Cách này phức tạp, không minimal effort và không áp dụng cho Cloud Run (phù hợp hơn với GKE hoặc Compute Engine). -
Configure the application code to send a small percentage of users to the newly deployed revision.
❌ Sai: Yêu cầu thay đổi code ứng dụng (ví dụ: feature flag trong code để route traffic), dẫn đến nỗ lực cao (phải code, test, deploy lại). Cloud Run hỗ trợ traffic splitting server-side native mà không cần chỉnh code, nên cách này không minimal và không tận dụng platform feature. -
Deploy the feature with “Serve this revision immediately” unchecked, and configure the new revision to serve a small percentage of traffic. Check for errors, and increase traffic to the revision as appropriate.
✅ Đúng: Như đã giải thích ở phần đáp án đúng. Đây là cách chính thức, minimal effort qua Console/gcloud CLI:- Deploy:
gcloud run deploy --no-traffic(unchanged "Serve immediately"). - Split traffic:
gcloud run services update-traffic SERVICE --to-revisions REVISION=10%. - Giám sát và scale up dần. Hoàn hảo cho SRE gradual rollout.
- Deploy:
-
Deploy the feature with “Serve this revision immediately” checked. Check for errors, roll back to the previous revision, and repeat the process until you have verified that the deployment is bug-free.
❌ Sai: Check "Serve immediately" sẽ route 100% traffic ngay lập tức đến revision mới, vi phạm gradual deployment (dễ gây downtime lớn nếu lỗi). Rollback lặp lại tốn công (dùnggcloud run services update-trafficrevert), không minimal effort và rủi ro cao – trái ngược mandate SRE.
-
A
1. Configure the service on GKE as a backend to an Apigee proxy.
2. Provide API keys to users to identify client applications.
3. Configure a Quota policy in Apigee for API keys based on the subscription tier. -
B
1. Configure the service on GKE as a backend to an Apigee proxy.
2. Provide API keys to users to identify client applications.
3. Configure a SpikeArrest policy in Apigee for API keys based on the subscription tier. -
C
1. Configure the service on GKE as a backend to two new projects, each with a separate Application Load Balancer.
2. Configure the quota "Queries per second (QPS) per region per network” for each project individually.
3. Provide users with API endpoints based on the subscription tier. -
D
1. Deploy the application to two GKE clusters, one for each subscription tier. Configure each cluster to have a separate Ingress.
2. Configure each cluster as a backend to an Apigee proxy.
3. Provide API keys to users to identify client applications.
4. Configure separate rate limits for client applications based on the subscription tier.
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 thiết kế kiến trúc ứng dụng trên Google Kubernetes Engine (GKE) cho một ứng dụng hướng ngoại (external-facing) cung cấp streaming API cho người dùng. Ứng dụng cần hỗ trợ hai gói subscription (tier): "basic" và "premium", dựa trên số lượng API requests tối đa mỗi ngày mà mỗi client application được phép thực hiện. Yêu cầu phải tuân thủ các best practices được Google khuyến nghị (Google-recommended practices).
Mục tiêu chính:
- Quản lý quota (giới hạn số lượng requests/ngày) theo tier.
- Xác thực và phân biệt client qua API keys.
- Tích hợp với GKE một cách hiệu quả, an toàn và scalable.
- Theo kiến thức cập nhật đến năm 2026, Google khuyến nghị sử dụng Apigee (API management platform) để xử lý quota, rate limiting, và API keys cho các ứng dụng trên GKE, thay vì các giải pháp thủ công phức tạp như multiple clusters/projects.
📘 Nguồn tham khảo:
- Apigee Documentation: Quota Policy (cập nhật 2025).
- GKE Best Practices for External APIs (khuyến nghị dùng Apigee làm proxy).
- Google Cloud Architecture: API Gateways (2026 edition).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng là phương án đầu tiên:
1. Configure the service on GKE as a backend to an Apigee proxy.
2. Provide API keys to users to identify client applications.
3. Configure a Quota policy in Apigee for API keys based on the subscription tier.
Lý do 🛠️:
- Apigee là giải pháp chính thức của Google để quản lý API, hỗ trợ Quota policy chính xác cho giới hạn requests theo thời gian (ví dụ: requests/ngày), phù hợp hoàn hảo với yêu cầu "số API requests mỗi ngày".
- Service GKE làm backend cho Apigee proxy đảm bảo scalability và security (Apigee xử lý traffic trước khi đến GKE).
- API keys dùng để identify client và áp quota theo tier (basic/premium) – đây là best practice từ Google.
- Giải pháp đơn giản, cost-effective, không cần multiple resources thừa.
📋 Giải thích tất cả các phương án (đúng/sai)
-
✅ Phương án ĐÚNG (như trên):
1. Configure the service on GKE as a backend to an Apigee proxy. 2. Provide API keys to users to identify client applications. 3. Configure a Quota policy in Apigee for API keys based on the subscription tier.Giải thích: Hoàn hảo theo best practices GCP. Quota policy trong Apigee cho phép set giới hạn requests theo interval (daily), key-based, dễ quản lý tier mà không phức tạp hóa infrastructure. ✅ Scalable và native integration với GKE.
-
❌ Phương án SAI 1:
1. Configure the service on GKE as a backend to an Apigee proxy. 2. Provide API keys to users to identify client applications. 3. Configure a SpikeArrest policy in Apigee for API keys based on the subscription tier.Giải thích: Sai vì SpikeArrest policy chỉ chống burst traffic (giới hạn requests/giây để tránh spike đột ngột), không phải quota dài hạn như "requests mỗi ngày". Không phù hợp với yêu cầu subscription tier dựa trên daily limit. ❌ Sử dụng sai policy.
-
❌ Phương án SAI 2:
1. Configure the service on GKE as a backend to two new projects, each with a separate Application Load Balancer. 2. Configure the quota "Queries per second (QPS) per region per network” for each project individually. 3. Provide users with API endpoints based on the subscription tier.Giải thích: Sai vì tạo hai projects riêng và Application Load Balancer (ALB) là overkill, tốn kém, khó quản lý (vi phạm best practices). Quota "QPS per region per network" là quota của Cloud DNS hoặc network-level, không phải API requests/ngày, và không hỗ trợ tier per client. ❌ Không scalable, không dùng API management đúng cách.
-
❌ Phương án SAI 3:
1. Deploy the application to two GKE clusters, one for each subscription tier. Configure each cluster to have a separate Ingress. 2. Configure each cluster as a backend to an Apigee proxy. 3. Provide API keys to users to identify client applications. 4. Configure separate rate limits for client applications based on the subscription tier.Giải thích: Sai vì deploy hai GKE clusters riêng cho tier là lãng phí tài nguyên, phức tạp ops (không recommended). Rate limits chung chung (không chỉ rõ policy) không đảm bảo quota daily chính xác; Apigee nên dùng một proxy duy nhất cho quota key-based. ❌ Phá vỡ nguyên tắc single cluster scalable trên GKE.
- A Configure workforce identity federation with the external IdP, and set up attribute mapping.
- B Configure a service account for each individual by using the user name and photo, and grant permissions for each user to impersonate their respective service accounts.
- C Configure workload identity federation to get the external IdP tokens, and use these tokens to sign in to the Google Cloud console.
- D Create a Google group that includes organization email IDs for all users. Ask users to use the same name, work email ID, and password to register and sign in.
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ích hợp danh tính từ nhà cung cấp danh tính bên ngoài (external Identity Provider - IdP) để cho phép nhân viên truy cập Google Cloud Console. Các yêu cầu chính bao gồm:
- ✅ Sử dụng cùng external IdP (ví dụ: Okta, Azure AD, hoặc các IdP OIDC/SAML) đã cấu hình sẵn cho users và groups trong tổ chức.
- ✅ Cá nhân hóa trải nghiệm đăng nhập bằng cách hiển thị tên và ảnh của người dùng trên Google Cloud Console.
- 🛠️ Mục tiêu: Đảm bảo truy cập an toàn, không cần tạo tài khoản Google riêng, và tận dụng federation để đồng bộ thông tin cá nhân hóa (personalization).
Đây là tình huống phổ biến trong Workforce Identity Federation của Google Cloud (cập nhật đến phiên bản mới nhất 2024-2026), giúp tránh quản lý mật khẩu kép và hỗ trợ SSO (Single Sign-On) với attribute mapping cho tên, ảnh từ IdP.
📘 Tài liệu tham khảo:
- Google Cloud Workforce Identity Federation
- Personalizing the Google Cloud console with Workforce Identity Federation (cập nhật 2024).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Configure workforce identity federation with the external IdP, and set up attribute mapping.
Lý do:
- 🛠️ Workforce Identity Federation (WIF) được thiết kế dành riêng cho workforce (người dùng con người), cho phép liên kết external IdP với Google Cloud IAM mà không cần tài khoản Google.
- ✅ Attribute mapping cho phép map các thuộc tính từ IdP (như
name,picturetừ OIDC claims hoặc SAML attributes) để hiển thị tên và ảnh trên Console, cá nhân hóa trải nghiệm đăng nhập. - Đây là giải pháp chính thức, an toàn, hỗ trợ OIDC/SAML, và tuân thủ zero-trust (không lưu trữ credentials). Đáp ứng đầy đủ yêu cầu mà không cần tạo tài khoản riêng.
🔍 Giải thích tất cả các phương án (đúng/sai)
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á với lý do rõ ràng dựa trên tài liệu Google Cloud mới nhất (2024-2026):
-
Configure workforce identity federation with the external IdP, and set up attribute mapping.
✅ Đúng. Như đã giải thích ở trên, đây là cách chuẩn xác nhất. WIF hỗ trợ map attributes để personalize Console (tên, ảnh từ IdP token). Không cần thay đổi IdP hiện tại. -
Configure a service account for each individual by using the user name and photo, and grant permissions for each user to impersonate their respective service accounts.
❌ Sai. Service accounts dành cho workloads/máy móc, không phải người dùng con người truy cập Console. Tạo SA cho từng user là không khả thi (quản lý khó, tốn kém), và impersonation không hỗ trợ personalize ảnh/tên trên Console. Vi phạm nguyên tắc least privilege. -
Configure workload identity federation to get the external IdP tokens, and use these tokens to sign in to the Google Cloud console.
❌ Sai. Workload Identity Federation (khác với Workforce) dành cho ứng dụng/non-human workloads (như Kubernetes pods), không hỗ trợ đăng nhập Console cho users. Token từ WIF không dùng cho Console sign-in cá nhân hóa. -
Create a Google group that includes organization email IDs for all users. Ask users to use the same name, work email ID, and password to register and sign in.
❌ Sai. Không tận dụng external IdP (yêu cầu tạo tài khoản Google riêng với password kép - kém an toàn). Google Groups chỉ quản lý quyền, không personalize ảnh/tên từ IdP, và vi phạm SSO. Không phải federation thực thụ.
🧩 Tóm tắt: Chỉ phương án đầu tiên đáp ứng đầy đủ yêu cầu federation + personalization. Các phương án sai nhầm lẫn giữa workforce/workload hoặc bỏ qua attribute mapping!
- A Deploy your API to App Engine. Create a Pub/Sub topic, and configure your API to push messages to the topic.
- B Deploy your API as a Cloud Run service. Create a Pub/Sub topic, and configure your API to push messages to the topic.
- C Deploy your API to a GKE cluster. Create a Kafka cluster, and configure your API to write messages to the cluster.
- D Deploy your API on a Compute Engine instance. Create a Kafka cluster, and configure your API to write messages to the cluster.
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 triển khai một API mới sử dụng giao thức gRPC để expose (phơi bày) ra ngoài. API này sẽ tạo các request trên một dịch vụ tin nhắn bất đồng bộ (asynchronous message service), và các request này sẽ được tiêu thụ bởi nhiều dịch vụ khác nhau. Mục tiêu chính là giảm thiểu overhead quản lý hạ tầng (minimizing infrastructure management overhead).
- Yêu cầu cốt lõi:
- Sử dụng gRPC (giao thức RPC hiệu suất cao, dựa trên HTTP/2).
- Tích hợp với dịch vụ tin nhắn bất đồng bộ (như Pub/Sub của Google Cloud, cho phép push/pull messages).
- Ưu tiên giải pháp serverless hoặc fully managed để tránh quản lý server, cluster, scaling thủ công.
✅ Bối cảnh kiến thức GCP cập nhật đến 2026: Google Cloud khuyến nghị Cloud Run cho các API gRPC serverless vì nó hỗ trợ native gRPC (từ phiên bản Cloud Run Gen2 năm 2023), tự động scale từ 0, tích hợp liền mạch với Pub/Sub (qua Cloud Pub/Sub triggers hoặc direct push). Pub/Sub là dịch vụ managed message queue chuẩn cho async communication. (Nguồn: Cloud Run Documentation & Pub/Sub Overview, cập nhật Q1/2026).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Deploy your API as a Cloud Run service. Create a Pub/Sub topic, and configure your API to push messages to the topic.
Lý do chi tiết 🛠️:
- Cloud Run là nền tảng serverless container lý tưởng cho API gRPC: Hỗ trợ full gRPC (bao gồm streaming), tự động scale, không cần quản lý hạ tầng (zero infra overhead). Bạn chỉ cần containerize API (Docker) và deploy.
- Pub/Sub topic là dịch vụ fully managed của GCP cho async messaging: API push messages vào topic, các consumer service khác pull từ đó – hoàn hảo cho multi-consumer.
- Tối ưu hóa: Không cần VPC, load balancer thủ công; tích hợp Eventarc/Pub/Sub triggers để trigger Cloud Run nếu cần. Giảm chi phí và quản lý so với cluster-based solutions.
- Cập nhật 2026: Cloud Run hỗ trợ gRPC-Web cho browser, và Pub/Sub Lite cho cost-optimized high-throughput. (Nguồn: gRPC on Cloud Run).
📋 Giải thích tất cả các phương án (đúng và sai)
-
[SAI] Deploy your API to App Engine. Create a Pub/Sub topic, and configure your API to push messages to the topic.
❌ Sai vì: App Engine (Standard) không hỗ trợ gRPC native (chỉ HTTP/1.1, cần proxy). App Engine Flexible hỗ trợ nhưng vẫn yêu cầu quản lý VM instances (scale chậm hơn Cloud Run), overhead cao hơn serverless thuần. Pub/Sub đúng nhưng platform không tối ưu cho gRPC/minimal management. (Nguồn: App Engine gRPC limits). -
[ĐÚNG] Deploy your API as a Cloud Run service. Create a Pub/Sub topic, and configure your API to push messages to the topic.
✅ Đúng vì: Như giải thích trên – serverless hoàn hảo, gRPC native, Pub/Sub push seamless, zero management. Lý tưởng cho API async với multi-consumers. -
[SAI] Deploy your API to a GKE cluster. Create a Kafka cluster, and configure your API to write messages to the cluster.
❌ Sai vì: GKE (Kubernetes) yêu cầu quản lý cluster (Autopilot vẫn overhead cao: node pools, networking). Kafka không phải GCP native (cần Confluent Cloud hoặc self-manage), kém hiệu quả so Pub/Sub (GCP khuyến nghị Pub/Sub cho async GCP workloads). Không minimize infra overhead. (Nguồn: GKE vs Cloud Run comparison). -
[SAI] Deploy your API on a Compute Engine instance. Create a Kafka cluster, and configure your API to write messages to the cluster.
❌ Sai vì: Compute Engine là VM managed thủ công (scale, patching, HA tự làm) – overhead cao nhất. Kafka tự quản lý càng tệ (không scalable dễ dàng). Không phù hợp gRPC serverless hoặc GCP best practices. Pub/Sub tốt hơn Kafka cho GCP. (Nguồn: Compute Engine best practices).
📘 Tài liệu tham khảo chính thức (cập nhật 2026)
- 🛠️ Cloud Run gRPC Guide
- 📡 Pub/Sub with Cloud Run
- 🔍 GCP Serverless Architecture
- ⚖️ So sánh: Cloud Run > App Engine/GKE cho low-overhead APIs (Google Cloud Next '25 Announcements).
Hy vọng phân tích này giúp bạn nắm vững! 🚀 Nếu cần code sample, hỏi thêm nhé!
- A Create and assign a custom role with the cloudsql.instances.connect permission to the custom service account. Adjust the Cloud SQL Auth Proxy start command to specify your instance connection name.
- B Grant the custom service account the roles/cloudsql.client role. Adjust the Cloud SQL Auth Proxy start command to use the --unix-socket CLI option.
- C Grant the custom service account the roles/cloudsql.editor role.
- D Grant the custom service account the roles/cloudsql.viewer role. Adjust the Cloud SQL Auth Proxy start command to specify your instance connection name.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi này tập trung vào việc triển khai một ứng dụng trên Compute Engine instance chạy Windows OS, kết nối với Cloud SQL thông qua Cloud SQL Auth Proxy. Bạn đã tạo một custom service account và cần thực hiện bước tiếp theo theo thực hành được Google khuyến nghị cùng nguyên tắc least privilege (quyền hạn tối thiểu).
- Bối cảnh chính:
- Ứng dụng cần kết nối an toàn đến Cloud SQL mà không lộ credential (như password).
- Cloud SQL Auth Proxy là công cụ proxy TCP giúp xác thực dựa trên service account IAM, mã hóa kết nối.
- Vì là Windows OS trên Compute Engine, lệnh khởi động proxy phải phù hợp (không dùng Unix socket).
- Least privilege: Tránh cấp role rộng, chỉ cấp permission cần thiết như
cloudsql.instances.connectđể proxy có thể kết nối. - Google-recommended practices: Sử dụng custom role thay vì predefined role để kiểm soát chặt chẽ, chỉ định instance connection name cho proxy.
Mục tiêu: Chọn bước next sau khi đã có custom service account để đảm bảo bảo mật, tuân thủ best practices. (Kiến thức cập nhật đến 2026: Cloud SQL Auth Proxy phiên bản mới nhất hỗ trợ Windows qua TCP với connection name, không thay đổi core permissions).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create and assign a custom role with the cloudsql.instances.connect permission to the custom service account. Adjust the Cloud SQL Auth Proxy start command to specify your instance connection name.
Lý do:
- 🛠️ Custom role với permission
cloudsql.instances.connect: Đây là permission tối thiểu cần thiết cho Cloud SQL Auth Proxy để xác thực và kết nối instance (theo docs chính thức). Nguyên tắc least privilege được tuân thủ vì tránh cấp quyền thừa (như list/get instances từ roles/cloudsql.client). - 📍 Chỉ định instance connection name: Trên Windows, proxy chạy qua TCP (port 3306/5432), yêu cầu flag
--instance-connection-name=PROJECT:REGION:INSTANCEtrong lệnh khởi động (ví dụ:./cloud_sql_proxy.exe -instances=...=tcp:3306). - ✅ Hoàn hảo khớp Google best practices: Custom SA + custom role + proxy config cho Windows.
📋 Giải thích tất cả các phương án
Dưới đây là phân tích từng lựa chọn một cách chi tiết:
-
Create and assign a custom role with the cloudsql.instances.connect permission to the custom service account. Adjust the Cloud SQL Auth Proxy start command to specify your instance connection name.
✅ Đúng (như đã giải thích ở trên). Đây là cách tối ưu cho least privilege và Windows OS. Proxy chỉ cần permission connect để hoạt động. -
Grant the custom service account the roles/cloudsql.client role. Adjust the Cloud SQL Auth Proxy start command to use the --unix-socket CLI option.
❌ Sai.roles/cloudsql.clientlà predefined role có nhiều permission thừa (connect + get + list + userRoles), vi phạm least privilege (nên dùng custom role chỉ connect).--unix-socketchỉ dành cho Linux/Unix (tạo Unix domain socket), không hỗ trợ trên Windows (gây lỗi runtime). Windows cần connection name + TCP.
-
Grant the custom service account the roles/cloudsql.editor role.
❌ Sai.roles/cloudsql.editorcấp quyền quá rộng (connect + create + update + delete instances/databases/users), vi phạm nghiêm trọng least privilege. Proxy chỉ cần connect, không cần edit.
-
Grant the custom service account the roles/cloudsql.viewer role. Adjust the Cloud SQL Auth Proxy start command to specify your instance connection name.
❌ Sai.roles/cloudsql.viewerchỉ có quyền read-only (get + list instances), thiếucloudsql.instances.connectcần thiết cho proxy kết nối. Dù config proxy đúng cho Windows, SA vẫn không authenticate được.
📘 Tài liệu tham khảo (cập nhật mới nhất đến 2026)
- Cloud SQL Auth Proxy docs: Connect using Cloud SQL Auth Proxy – Xác nhận permission
cloudsql.instances.connectvà custom role cho least privilege. - IAM roles for Cloud SQL: Cloud SQL IAM roles – Chi tiết permissions, khuyến nghị custom role.
- Windows-specific guide: Proxy on Compute Engine (Windows) – Yêu cầu connection name, không unix-socket.
- Best practices: Security best practices – Nhấn mạnh least privilege với custom roles.
Hy vọng phân tích này giúp bạn nắm vững! 🚀 Nếu cần thêm ví dụ code lệnh proxy, hãy hỏi nhé!
- A Create signed policy documents on the Cloud Storage bucket.
- B Apply access control list (ACL) permissions to the Cloud Storage bucket.
- C Generate a signed URL for each document the user wants to share.
- D Grant the Storage Object Viewer IAM role to all authenticated users.
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 phát triển một nền tảng chia sẻ tài liệu an toàn sử dụng Google Cloud Storage (không phải AWS S3, dù đề cập chủ đề liên quan AWS nhưng nội dung rõ ràng là Cloud Storage của Google Cloud). Các yêu cầu chính bao gồm:
- Người dùng chia sẻ tài liệu với người dùng bên ngoài tổ chức (không cần tài khoản Google Cloud).
- Truy cập phải được thu hồi tự động sau thời gian cấu hình (ví dụ: hết hạn sau 1 giờ, 1 ngày...).
- Tài liệu lưu trữ trong bucket Cloud Storage.
- Giải pháp cần an toàn, tạm thời, không cấp quyền vĩnh viễn, và hỗ trợ kiểm soát thời gian chính xác.
Mục tiêu cốt lõi: Tạo cơ chế chia sẻ tạm thời (time-bound) mà không cần cấp quyền IAM/ACL rộng rãi, phù hợp với signed URLs – tính năng chuẩn của Cloud Storage để truy cập/read/write tạm thời qua URL có chữ ký.
📘 Tài liệu tham khảo: Cloud Storage Signed URLs (cập nhật 2024-2026, hỗ trợ v4 signing process với expiration time linh hoạt).
✅ Đáp án đúng và lý do lựa chọn
Generate a signed URL for each document the user wants to share.
🛠️ Lý do đúng:
- Signed URL cho phép tạo liên kết tạm thời để truy cập/read tài liệu mà không cần tài khoản Google Cloud (phù hợp chia sẻ external users).
- Có thể cấu hình thời gian hết hạn chính xác (expiration time) từ giây đến năm, tự động thu hồi truy cập khi hết hạn.
- An toàn nhờ chữ ký HMAC từ service account key, ngăn chặn giả mạo.
- Hỗ trợ GET (download) hoặc PUT (upload nếu cần), lý tưởng cho chia sẻ document.
- Phiên bản mới nhất (2026): Signed URLs v4 cải thiện bảo mật với key rotation và audience enforcement.
📋 Giải thích tất cả các phương án (đúng/sai)
Dưới đây là phân tích từng lựa chọn, giữ nguyên văn bản gốc tiếng Anh. Mỗi phương án được đánh giá dựa trên khả năng hỗ trợ chia sẻ tạm thời với external users và thu hồi theo thời gian cấu hình.
-
❌ Create signed policy documents on the Cloud Storage bucket.
Sai vì: Signed policy documents dùng cho upload objects (POST policy), không phù hợp chia sẻ/download tài liệu. Chúng chỉ kiểm soát upload tạm thời, không hỗ trợ read access cho external users với thời hạn linh hoạt. Bucket-level policy không granular per document và không tự thu hồi read access. -
❌ Apply access control list (ACL) permissions to the Cloud Storage bucket.
Sai vì: ACL là quyền vĩnh viễn (không có expiration time), chỉ cấp cho user/group cụ thể (cần email Google account). Không hỗ trợ external users không có tài khoản, và bucket-level ACL quá rộng (ảnh hưởng tất cả objects). ACL deprecated từ 2023, khuyến nghị dùng IAM thay thế – không đáp ứng "thu hồi sau thời gian cấu hình". -
✅ Generate a signed URL for each document the user wants to share.
Đúng như giải thích ở trên: Hoàn hảo cho truy cập tạm thời, per-object, external sharing, với expiration tự động. Đây là best practice cho secure document sharing. -
❌ Grant the Storage Object Viewer IAM role to all authenticated users.
Sai vì: IAM role cấp quyền vĩnh viễn cho tất cả authenticated users (nhóm "allUsers" hoặc "allAuthenticatedUsers"), không có thời hạn thu hồi. Quá rộng rủi ro bảo mật (public read), không kiểm soát per-document hoặc external non-auth users. IAM không hỗ trợ time-bound access trực tiếp.
🧠 Kết luận: Signed URL là giải pháp tối ưu, tuân thủ nguyên tắc least privilege và zero-trust. Nếu cần scale, kết hợp với Cloud Functions để generate URL động!
📘 Nguồn bổ sung: Cloud Storage Access Control & IAM Best Practices (Google Cloud docs 2026).