📘

生成AIと取り組むGoogle Cloud認定試験対策

2025/03/13に公開

はじめに

この記事では、Google Cloud Certified Professional Cloud Database Engineer(以下PCDEと略) 試験の模擬問題作成に生成AIを活用する方法について検討します。具体的には、Google の Gemini 2.0 Pro Experimental と Anthropic の Claude 3.7 Sonnet という2つの異なる生成AIモデルを使用し、そのアウトプットを比較します。
模擬問題の質、特に実際のユースケースに基づいた問題が作成できるかどうかに焦点を当てて評価しました。

背景

PCDE試験は、Google Cloud Platform (GCP) 上でのリレーショナルデータベースおよび NoSQL データベースの設計、管理、トラブルシューティングに関する知識とスキルを評価する認定資格です。
認定試験に対する解説や対策法については日本語でもいくつかの有用な記事が存在します。
https://blog.g-gen.co.jp/entry/professional-cloud-database-engineer

多くの方が言及している通り、模擬問題に取り組むことが重要かつ効率的な対策ではありますが、公式のものは20問しかなく、またUdemyなどで用意されている模擬問題は有償であったり、ボリュームが多く隙間時間に少し取り組むという類のものではないと感じます。また、PCDE試験は2025年3月時点では日本語版は提供されていません。
そこで今回は、生成AIを活用して試験対策用の模擬問題を作成する方法について検証しました。

使用した生成AIモデルとプロンプト

使用モデル

いずれも各社が提供するWEBブラウザ版のチャットAppを使用しています。

  • Gemini 2.0 Pro Experimental: Google が開発した最新のマルチモーダル生成AIモデル (実験段階)。
  • Claude 3.7 Sonnet: Anthropic が開発した高性能な生成AIモデル。

ちなみにChatGPTの利用も試みましたが、インプットプロンプトのサイズが大きすぎて無料枠では実行できなかったため、断念しました。

Deep Researchについて

実は当初はこの記事はDeep Researchを使った学習方法について書くつもりでした。しかし模擬問題を作成する、というタスクに関しては必ずしもDeep Researchを使う必要性は無さそうと判断したので上述のモデルを使用するように方針変更しました。しかしDeep Researchを使うことで、例えば「Alloy DBについてGoogle Cloud Certified Professional Cloud Database Engineer 試験対策の観点で調査してください」のような指示をすると、50近い記事を参照して包括的に内容をまとめてくれるので、まずは全体概要を掴む、や自分の中で不明瞭な部分を強化したい、という際にはとても有効な策であると思います。

プロンプト

今回の検証のために作成したプロンプトです。こちらは両モデルに対して以下のプロンプトを使用しました。

You are a Author of Google Cloud Certified Examination.
I am studying a Google Cloud Certified Professional Cloud Database Engineer Exam.
The Document is an official sample Questions and Answers. It has 20 Questions and Answers and Feedbacks.

[The Document]
*ここには公式の模擬問題のQAと解説を20問全部コピー&ペーストします。

[tasks]
1. Read the document specifically.
2. Generate 10 sample Question an Answers and feedbacks referring task 1.
3. Output of task 2 is in should be in English.

[notice]
The sample QA does not include Alloy DB issues because Alloy DB is very new therefore the exam does not cover it yet.
You need to generate QA related to Alloy DB and include it to sample QAs.

プロンプトのポイント:

  • 役割設定: You are a Author of Google Cloud Certified Examination. とすることで、試験作成者の視点を持つように指示。
  • 公式模擬問題の参照: [The Document] に公式の模擬問題と解説を入力し、これをベースに問題を作成するように指示。
  • AlloyDB に関する問題の追加: [notice] で、公式模擬問題には含まれていない AlloyDB に関する問題も生成するように指示。これは、AlloyDB が比較的新しいサービスであるため、試験範囲に含まれる可能性があると考えたためです。

検討パラメータ

以下のパラメータを変えながら、生成される模擬問題の質を比較しました。

  • 使用するモデル: Gemini 2.0 Pro Experimental / Claude 3.7 Sonnet
  • アウトプットするQAの数: 10問 / 20問
  • アウトプットの言語: 日本語 / 英語

結果と考察

様々なパラメータの組み合わせで試した結果、

Claude 3.7 Sonnet + 10問 + 英語

の組み合わせが最も良好な結果と感じました。ただし、使用するモデルによるアウトプットの差はほとんど違いが感じられず、好みの問題であるように思われます。

主な理由は以下の通りです。

  • 問題の質: アウトプットする問題数を増やすと、問題の質が低下する傾向が見られました。具体的には、サービスの基本的な機能に関する知識を問う問題が増え、実際のユースケースに基づいたシナリオ問題が減少しました。10問に絞ることで、より実践的な問題が生成されるように感じました。
  • Claude 3.7 Sonnet の優位性: Gemini 2.0 Pro Experimental と比較して、Claude 3.7 Sonnet はより自然で、試験問題として適切な表現の問題文を生成する傾向がありました。
  • 英語での出力: 今回は英語の試験対策を想定しているため、英語での出力を選択しました。日本語で出力しても精度は変わらないと感じました。(インプットプロンプトは英語のほうがよい)
  • 出力結果の正確さ: パラメータではないですが、出力結果があっているかのチェック(ただし自分の知識に関する範囲で)も行いました。自分が確認した限りだとGemini2.0 Pro Experimentalのほうに一問だけ誤りがありました。誤りといっても、事実と異なるというわけではなく、正解は一つと示されているのに解説には2つ正答があった(なお2つとも事実としては正しい)、という類のものです。それ以外は両モデルとも正確でした。

以下は、それぞれのモデルで生成した問題、解答、解説の一例です。
Claude 3.7 Sonnet 10問作成を指示

Question 5
Your company has a Cloud SQL for PostgreSQL instance that contains sensitive customer data. You need to implement a comprehensive backup strategy that meets regulatory requirements for data retention. The requirements state that you must keep daily backups for 30 days, weekly backups for 3 months, and monthly backups for 7 years. What should you do?
A. Configure automated backups with a retention period of 7 years.
B. Use point-in-time recovery with a transaction log retention of 7 years.
C. Implement automated backups with a 30-day retention, and use Cloud Functions with Cloud Scheduler to create and manage the weekly and monthly backups.
D. Export database dumps to Cloud Storage with different storage classes and lifecycle policies for the different retention periods.
Feedback
D is correct because by exporting database dumps to Cloud Storage, you can leverage different storage classes (Standard, Nearline, Coldline, Archive) and set up lifecycle policies to automatically transition or delete objects based on your retention requirements. This provides a cost-effective way to maintain backups for varying periods.
A is not correct because Cloud SQL automated backups have a maximum retention period of 365 days, which doesn't meet the 7-year requirement.
B is not correct because point-in-time recovery and transaction logs are not designed for long-term backup retention, but rather for disaster recovery purposes.
C is not correct because while this approach could work, it would require significant custom development and maintenance, making it less reliable and more complex than using Cloud Storage lifecycle policies.
https://cloud.google.com/sql/docs/postgres/backup-recovery/backups
https://cloud.google.com/storage/docs/lifecycle
Question 13
Your company is experiencing performance issues with a PostgreSQL database running on Cloud SQL, especially with analytical queries that scan large amounts of data. You want to improve query performance without significant changes to your application code. What should you do?
A. Increase the CPU and memory of the Cloud SQL instance.
B. Migrate to AlloyDB for PostgreSQL to leverage its column store engine.
C. Add more read replicas to distribute the analytical workload.
D. Implement partitioning on large tables in the existing database.
Feedback
B is correct because AlloyDB for PostgreSQL includes a columnar engine that significantly accelerates analytical queries by using column-based storage, which is more efficient for scanning large amounts of data. This provides performance improvements without requiring application changes since AlloyDB maintains full PostgreSQL compatibility.
A is not correct because while increasing resources may provide some performance improvement, it doesn't address the fundamental inefficiency of row-based storage for analytical queries.
C is not correct because read replicas still use the same row-based storage and query execution model, which is not optimal for analytical queries that scan large amounts of data.
D is not correct because while partitioning can help with certain workloads, it doesn't provide the same level of optimization for analytical queries as columnar storage.
https://cloud.google.com/alloydb/docs/reference/columnar-engine

Gemini2.0 Experimental 10問作成を指示

Question 7

You are migrating a large PostgreSQL database to AlloyDB.  You want to leverage AlloyDB's performance benefits as quickly as possible after the migration. What should you prioritize enabling immediately after the migration is complete?

A.  Query Insights.
B.  The columnar engine.
C.  Cross-region replication.
D.  IAM integration.

Feedback

A is not correct, Query Insights is to find the improvement after the migration.
B is correct because enabling the columnar engine will immediately start providing performance benefits for analytical queries.  The other options are important but don't directly impact performance as immediately.
C is not correct because cross-region replication is for disaster recovery, not immediate performance gains.
D is not correct because IAM integration should ideally be set up before the migration as part of the initial setup.

Gemini2.0 Experimental 20問作成を指示

Question 4

You are designing a global e-commerce application.  You need a database that offers strong consistency, horizontal scalability, and multi-region replication with minimal latency. Which database service is the BEST fit?

A.  Cloud SQL for MySQL
B.  Firestore in Datastore mode
C.  Cloud Spanner
D.  Bigtable

Answer: C

Feedback:

A is incorrect: Cloud SQL is a regional service and doesn't offer the global scale and multi-region capabilities as easily as Spanner.
B is incorrect: Firestore in Datastore mode is optimized for different use cases (mobile/web apps) and, while offering multi-region, doesn't provide the same level of strong consistency across regions as Spanner.
C is correct: Cloud Spanner is specifically designed for globally distributed applications requiring strong consistency, horizontal scalability, and multi-region replication.
D is incorrect: Bigtable is excellent for high-throughput, low-latency workloads but is not designed for transactional workloads requiring strong consistency.

まとめと今後の展望

PCDE試験に限らず、この手の試験の模擬問題作成において、生成AIは非常に有効なツールとなり得ることがわかりました。任意のチャットAppを使って今回のプロンプトで指示し一度アウトプットした後、内容が分からない部分についての追加質問もしやすいので、効率的に学習をすることもできます。

今後は、

  • より詳細なプロンプトエンジニアリングによる品質向上
  • 生成された問題の自動評価
  • 利用者がパラメータ(モデルの選択、QAの数、出力言語、試験名など)を任意で入力できるアプリの開発

などに取り組むことで、より効率的かつ効果的な試験対策を実現できる可能性があります。

この検討が、PCDE試験の合格を目指す皆様の一助となれば幸いです。


Discussion