Cloud Spanner Emulator を触ってみる
注意
いくつか使えない機能がある
TLS/HTTPS, 認証, IAM, 権限, Role
PLAIN, PROFILE クエリモード
クエリの実行計画や実行統計は見れない
監査ログ、モニタリングツール
異なる部分もある
エラーメッセージ
パフォーマンス、スケーラビリティ
rw transaction, スキーマ変更は排他的にロックを行う
起動
GCloud
code:sh
gcloud components update
gcloud beta emulators spanner start
Docker
code:sh
docker pull gcr.io/cloud-spanner-emulator/emulator
docker run -p 9010:9010 -p 9020:9020 gcr.io/cloud-spanner-emulator/emulator
code:sh
// spanner-emulator用のconfigを作る
gcloud config configurations create spanner-emulator
gcloud config set auth/disable_credentials true
gcloud config set project spanner-emulator
// instance作成
gcloud spanner instances create test --config spanner-emulator --description "test" --nodes=1
// database作成
gcloud spanner databases create test --instance test
// database test に接続
SPANNER_EMULATOR_HOST=localhost:9010 spanner-cli -p spanner-emulator -i test -d test