このページの一部またはすべての情報は、S3NS の Trusted Cloud に適用されない場合があります。詳細については、
Google Cloud との違いをご確認ください。
Cloud SQL の概要
Cloud SQL は、MySQL、PostgreSQL、SQL Server 用のフルマネージド リレーショナル データベース サービスです。これにより、データベース管理タスクから解放され、データの管理により多くの時間をかけることができます。
このページでは、 Trusted Cloudの SQL データ ストレージを提供する Cloud SQL の基本コンセプトと用語について説明します。主なコンセプトの詳細については、主な用語と機能のページをご覧ください。Cloud SQL データベースの比較については、データベース エンジンによる Cloud SQL の機能サポートをご覧ください。
Cloud SQL のユースケース
Cloud SQL は、ローカル MySQL、PostgreSQL、SQL Server データベースの代替となるクラウドベースのサービスです。Cloud SQL を使用することで、データベースの管理にかかる時間を減らし、データベースを使用する時間を増やすことができます。
Compute Engine、App Engine、 Trusted Cloud by S3NS の他のサービスで実行されている多くのアプリケーションでは、データベース ストレージに Cloud SQL を使用します。
Cloud SQL が提供するもの
Cloud SQL には多数のサービスが用意されているため、そうしたサービスを自分で構築して管理する必要はありません。ユーザーはデータそのものに集中し、次のようなオペレーションを Cloud SQL に任せることができます。
Cloud SQL インスタンスとは
各 Cloud SQL インスタンスは、ホスト Trusted Cloud サーバー上で実行されている仮想マシン(VM)を利用します。各 VM は、MySQL サーバー、PostgreSQL、SQL Server などのデータベース プログラムと、ロギングやモニタリングなどのサポート サービスを提供するサービス エージェントを運用します。また、高可用性オプションでは、別のゾーンにプライマリ VM と同一の構成を持つスタンバイ VM も用意されています。
データベースは、スケーラビリティと耐久性に優れたネットワーク ストレージ デバイスに保存されます。このデバイスは persistent disk
と呼ばれ、VM にアタッチされます。静的 IP アドレスは各 VM に割り当てられ、アプリケーションの接続先の IP アドレスが Cloud SQL インスタンスの全存続期間を通して持続するようにします。
Cloud SQL インスタンスの概要:

データベース管理
Cloud SQL を使ってデータベースとデータベース ユーザーを作成、削除することもできますが、Cloud SQL はデータベース管理ツールではありません。データベース エンジンに応じて、次のようなさまざまなデータベース管理ツールを選択できます。
Cloud SQL マネージド データベースに接続する
Cloud SQL マネージド データベースへの接続は、セルフマネージド データベースに接続する場合と同様です。Cloud SQL インスタンスは、構成方法に応じて、パブリック IP アドレス(Trusted Cloud外部からインターネット経由でアクセス可能)またはプライベート IP アドレス(Virtual Private Cloud(VPC)ネットワーク経由でのみアクセス可能)を使用します。さらに、Cloud SQL には Cloud SQL Auth Proxy をはじめ、インスタンスに接続できるユーザーを制御するためのさまざまな認可オプションが用意されています。
Cloud SQL インスタンスに接続して、認証と認可を行う方法については、接続の概要ページをご覧ください。
Cloud SQL の更新
Cloud SQL インスタンスの利用期間中は、次の 2 種類の更新が発生する可能性があります。
- 構成の更新。ユーザーが行った更新。
- Cloud SQL で実行されるシステム更新。
構成の更新
データベースの使用量が増加し、新しいワークロードが追加されるのに応じ、ユーザー側でデータベースの構成を更新できます。構成の更新には、次のようなものがあります。
- コンピューティング リソースの増加
- データベース フラグの変更
- 高可用性の有効化
こうした更新は、Cloud SQL を使用すればボタンをクリックするだけで可能ですが、構成を更新するとなるとダウンタイムが必要な場合があります。ただし、Cloud SQL には、ダウンタイムを最小限に抑えてデータベースを引き続き使用できるようにするオプションがいくつか用意されています。
システムの更新
データベース インスタンスの稼働状態を維持するには、構成の更新以外にも運用上の多くの作業が求められます。サーバーやディスクの交換およびアップグレードが必要ですし、新しい脆弱性が発見された場合には、オペレーティング システムにパッチを適用しなければなりません。データベース ソフトウェア プロバイダが新機能をリリースし、新しい問題を修正するたびに、データベース プログラムをアップグレードする必要も生じます。データベース管理者は通常、システムの信頼性と安全性を保ち、最新の状態に保つために、これらの更新を定期的に実行します。Cloud SQL は、こうした定期的なシステム更新に対応するため、データベースの管理に費やす時間を削減し、優れたアプリケーションを開発するための時間を確保できます。
Cloud SQL がシステム更新を実行するプロセスは、更新されるシステムの部分によって異なります。一般に、Cloud SQL のシステム更新は、ハードウェアの更新、オンラインの更新、メンテナンスの 3 つのカテゴリに分類されます。
ハードウェア更新では、欠陥のあるマシンホストの交換や古いディスクの交換など、物理インフラストラクチャの改善が行われます。Trusted Cloud により、アプリケーションを中断することなくハードウェアが更新されます。たとえば、データベース サーバーを更新する場合、 Trusted Cloudではライブ マイグレーションを使用します。これは、VM を実行中のまま、元のホストから新しいホストに確実に移行する高度なテクノロジーです。
オンラインの更新により、VM のデータベース プログラムに隣接するサポート サービス エージェントのソフトウェアが強化されます。この更新は、データベースが稼働してトラフィックを処理している間に実行されます。オンラインの更新によってアプリケーションのダウンタイムが発生することはありません。
メンテナンスにより、オペレーティング システムとデータベース プログラムがアップグレードされます。これらの更新ではインスタンスの再起動が必要になるため、ダウンタイムが発生します。このため、Cloud SQL では、アプリケーションへの影響を最小限に抑えながら、メンテナンスのスケジュールを設定できます。
PostgreSQL 用の Cloud SQL Enterprise Plus エディションまたは MySQL 用の Cloud SQL Enterprise Plus エディションを使用している場合は、ダウンタイムを 1 秒未満のダウンタイムに制限できます。
次のステップ
以下のクイックスタートをお試しください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[],[],null,["# Cloud SQL overview\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nCloud SQL is a fully managed relational database service for MySQL,\nPostgreSQL, and SQL Server. This frees you from database administration tasks so\nthat you have more time to manage your data.\n\nThis page discusses basic concepts and terminology for Cloud SQL, which\nprovides SQL data storage for Google Cloud. For a more in-depth\nexplanation of key concepts, see the [key terms](/sql/docs/key-terms)\nand [features](/sql/docs/features) pages. For information about how\nCloud SQL databases compare with one another, see\n[Cloud SQL feature support by database\nengine](/sql/docs/feature_support).\n\nUse cases for Cloud SQL\n-----------------------\n\nCloud SQL provides a cloud-based alternative to local MySQL, PostgreSQL,\nand SQL Server databases. You should use Cloud SQL if you want to spend\nless time managing your database and more time using it.\n\nMany applications running on Compute Engine, App Engine and other\nservices in Google Cloud use Cloud SQL for database storage.\n\nWhat Cloud SQL provides\n-----------------------\n\nCloud SQL offers many services so you don't have to build and maintain\nthem yourself. You can focus on your data and let Cloud SQL handle the\nfollowing operations:\n\n- [Backups](/sql/docs/mysql/backup-recovery/backups)\n- [High availability and failover](/sql/docs/mysql/high-availability)\n- [Network connectivity](/sql/docs/mysql/connect-overview)\n- [Export and import](/sql/docs/mysql/import-export)\n- [Maintenance and updates](/sql/docs/mysql/maintenance)\n- [Monitoring](/sql/docs/mysql/monitor-instance)\n- [Logging](/sql/docs/mysql/logging)\n\nWhat is a Cloud SQL instance?\n-----------------------------\n\nEach Cloud SQL instance is powered by a virtual machine (VM) running on a\nhost Google Cloud server. Each VM operates the database program, such as\nMySQL Server, PostgreSQL, or SQL Server, and service agents that provide\nsupporting services, such as logging and monitoring. The high\navailability option also provides a standby VM in another zone with a\nconfiguration that's identical to the primary VM.\n\nThe database is stored on a scalable, durable network storage device called a\n`persistent disk` that attaches to the VM. A static IP address sits in front\nof each VM to help make sure that the IP address an application connects to\npersists throughout the lifetime of the Cloud SQL instance.\n\nCloud SQL instance overview:\n\nDatabase administration\n-----------------------\n\nCloud SQL lets you create and delete databases and database users,\nbut it isn't a database administration tool. There are many database\nadministration tools you can choose from, depending on your database engine,\nincluding the following:\n\n- [phpMyAdmin](https://www.phpmyadmin.net/) for MySQL\n- [MySQL Workbench](https://www.mysql.com/products/workbench/) for MySQL\n- [Toad Edge](https://www.quest.com/products/toad-edge/) for MySQL and PostgreSQL\n- [pgAdmin.org](https://www.pgadmin.org/) for PostgreSQL\n- [SQL Server Management Studio](https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15) for SQL Server\n- [Visual Studio Code](https://code.visualstudio.com/) for SQL Server\n\nCloud SQL pricing\n-----------------\n\nCloud SQL pricing varies with your configuration settings, and depends on:\n\n- How much storage you provision, in GiB per month\n- How many CPUs you select for your Cloud SQL instance\n- How much memory you select for your Cloud SQL instance\n- Where you choose to host your data\n- How much network traffic leaves your instance\n- How many IP addresses you assign and use\n\nCheck out some [Cloud SQL pricing\nexamples](/sql/docs/pricing-examples). For more information, see the [pricing](/sql/pricing)\npage.\n| You can create an account to evaluate how Cloud SQL performs in real-world scenarios. New customers also get $300 in free credits to spend on Cloud SQL to run, test, and deploy workloads. You won't be charged until you upgrade.\n|\n| Sign up to [try Cloud SQL for free](https://console.cloud.google.com/freetrial?redirectPath=/sql).\n\nConnect to a Cloud SQL managed database\n---------------------------------------\n\nConnecting to a Cloud SQL managed database is similar to connecting to a\nself-managed database. Depending on how you configure it, your Cloud SQL\ninstance has a public IP address (which can be accessed from outside of\nGoogle Cloud, using the internet), or a private IP address (which can only\nbe accessed through a [Virtual Private Cloud (VPC) network](/vpc/docs/overview)).\nIn addition, Cloud SQL provides different authorization options to control\nwho is allowed to connect to your instance, such as the\n[Cloud SQL Auth Proxy](/sql/docs/mysql/sql-proxy).\n\nFor more details on how to connect, authorize, and authenticate to your\nCloud SQL instance, see the\n[Connecting Overview](/sql/docs/mysql/connect-overview) page.\n\nCloud SQL updates\n-----------------\n\nOver the life of a Cloud SQL instance, two kinds of updates can occur:\n\n- **Configuration updates**, which are done by the user.\n- **System updates**, which are performed by Cloud SQL.\n\n### Configuration updates\n\nAs your database's usage grows and new workloads are added, you might want to\nupdate your database configuration to adapt accordingly. Configuration\nupdates include:\n\n- Increasing compute resources\n- Modifying a database flag\n- Enabling high availability\n\nAlthough Cloud SQL makes these updates possible with the click of a\n[button](/sql/docs/mysql/edit-instance), some configuration\nupdates can require downtime. However, Cloud SQL offers several\noptions to minimize downtime so that your databases can\nremain available.\n\n### System updates\n\nKeeping the database instance up and running requires operational effort beyond\nconfiguration updates. Servers and disks need to be replaced and upgraded.\nOperating systems need to be patched as new vulnerabilities are discovered.\nDatabase programs need to be upgraded as the database software provider releases\nnew features and fixes new issues. Normally, a database administrator\nperforms each of these updates regularly in order to ensure their systems stay\nreliable, protected, and up-to-date. Cloud SQL attends to these regular\nsystem updates for you, so you can spend less time\nmanaging your database and more time developing great applications.\n\nThe process Cloud SQL uses to perform system updates varies based on\nwhich part of the system is getting updated. In general, Cloud SQL system\nupdates are divided into three categories: hardware updates, online updates, and\nmaintenance.\n\n**Hardware updates** improve the physical infrastructure, such as\nswapping out a defective machine host or replacing an old disk.\nGoogle Cloud performs hardware updates without interruption to your\napplication. For example, when updating a database server, Google Cloud\nuses live migration, an advanced technology that reliably migrates a VM from the\noriginal host to a new one while the VM stays running.\n\n**Online updates** enhance the software of the supporting service agents that\nsit adjacent to the database program on the VM. These updates are performed\nwhile the database is up and running, serving traffic. Online updates do not\ncause downtime for your application.\n\n[**Maintenance updates**](/sql/docs/mysql/maintenance) apply upgrades to the\noperating system and the database program. Because\nthese updates require an instance restart, they incur some downtime.\nFor this reason, Cloud SQL lets you schedule maintenance to occur\nat a time that is the least disruptive to your application.\n\nIf you're using [Cloud SQL Enterprise Plus edition](/sql/docs/mysql/editions-intro#availability-enhancements) for PostgreSQL\nor Cloud SQL Enterprise Plus edition for MySQL,\nthen you can limit that downtime to [sub-second downtime](/sql/docs/mysql/maintenance#nearzero).\n\n\nWhat's next\n-----------\n\nTry out one or more of the quickstarts for:\n\n- [MySQL](/sql/docs/mysql/connect-instance-cloud-shell)\n- [PostgreSQL](/sql/docs/postgres/connect-instance-cloud-shell)\n- [SQL Server](/sql/docs/sqlserver/connect-instance-cloud-shell)"]]