4.3 ストレージ

GCP Storage Services

GCPのストレージサービスは、Cloud Storage(オブジェクト)、Persistent Disk(ブロック)、Filestore(ファイル)を提供する。シンプルな料金体系と、BigQueryとの統合によるデータ分析が強みである。

Cloud Storage

Cloud Storage構造

図1: Cloud Storageの構造と統合

ストレージクラス 最小保存期間 ユースケース AWS対応
Standard なし 頻繁アクセス S3 Standard
Nearline 30日 月1回程度 S3 Standard-IA
Coldline 90日 四半期1回程度 S3 Glacier Instant
Archive 365日 年1回未満 S3 Glacier Deep Archive
GCP独自機能: Autoclass
Autoclassを有効にすると、オブジェクトのアクセスパターンに応じてストレージクラスを自動的に変更する。手動でライフサイクルポリシーを設定する必要がなくなる。

Persistent Disk

Persistent Diskタイプ

図2: Persistent Diskのタイプと機能

タイプ 最大IOPS 用途
pd-balanced 80,000 汎用(推奨)
pd-ssd 100,000 高性能DB
pd-extreme 120,000 最高性能要求
pd-standard 7,500 バックアップ、ログ

BigQueryとの統合

Cloud StorageとBigQuery統合

図3: Cloud StorageとBigQueryのデータ分析連携

Cloud StorageはBigQueryと緊密に統合されている。外部テーブル機能により、GCS上のデータをBigQueryにロードせずに直接SQLでクエリできる。CSV、JSON、Parquet、ORC等の形式をサポート [1]。

出典
[1] Google Cloud. Cloud Storage Documentation. https://cloud.google.com/storage/docs/
[2] Google Cloud. Persistent Disk Documentation. https://cloud.google.com/compute/docs/disks/
発展学習
→ Cloud Storage Autoclass
→ BigQuery external tables