PaaS(Platform as a Service) と CaaS(Container as as Service) Cloud Run や App RunnerもCaaS(Container as a Service)と呼んで良いのでは と思っていたが、Google Cloudのドキュメントによると https://cloud.google.com/learn/paas-vs-iaas-vs-saas?hl=ja CaaS: GKE PaaS: GAE、Cloud Run とのこと Nextat Inc. 6
極振りしたい コンテナのマネージドサービス とは 本資料でメインに扱う コンテナのマネージドサービス は DockerfileやBuildpacks(後述)の設定だけすれば良い感じにコンテナとして Webアプリを動かしてくれるサービス コンテナベースのPaaS と分類するのが良さそう CaaS は Container Runtime as a Service くらいのニュアンスかなと思ってい たが、 Container Orchestrator as a Service のほうが近そう Amazon ECSはCaaSで良い? セッションのタイトルにCaaSと入れてなくてよかった Nextat Inc. 7
そもそもコンテナとは 仮想化の一種 OSは共有し、ハードウェアは仮想化しない ハイパーバイザ型の仮想化(ex. Hyper-V、VirtualBox)に比べ軽量でリソー ス利用の効率が良い ホストOSの他のプロセスからの隔離+リソース制限 ポータビリティ(可搬性)が高い Build, Ship and Run Any App, Anywhere by Docker 本番環境に近い構成をローカル環境で再現しやすい Nextat Inc. 8
例6 Cloud Run https://cloud.google.com/run?hl=ja Dockerfile対応 Google Cloud BuildpacksというCNB準拠な仕組みがあるがPHPは非対応 実体はマネージドKnative: https://cloud.google.com/knative?hl=ja FaaSと同じく料金含めゼロスケールするのが特徴 カナリアリリースなど機能が充実 Nextat Inc. 30
DBaaSの例 Supabase Postgres https://supabase.com/docs/guides/database/overview Supabase自体は Backend as a Service DigitalOcean https://www.digitalocean.com/products/managed-databases DigitalOcean自体はDBaaSというよりはクラウドプロバイダ 最寄りRegionはシンガポール Aiven(アイベン) https://aiven.io/ja MySQL、PostreSQL、 Redis、OpenSearch etc. AWS、Azure、GCP、DigitalOceanなどクラウドやリージョン間の移行が可 能 Nextat Inc. 40
SKIP LOCKEDの参考 MySQL :: MySQL 8.0.1: Using SKIP LOCKED and NOWAIT to handle hot rows https://dev.mysql.com/blog-archive/mysql-8-0-1-using-skip-locked- and-nowait-to-handle-hot-rows/ What's new in PostgreSQL 9.5 - PostgreSQL wiki https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.5#SKIP _LOCKED PostgreSQLのSKIP LOCKEDを使ってテーブルをキューとして使用する - Enjoy*Study https://blog.enjoyxstudy.com/entry/2017/09/10/000000 Nextat Inc. 56
例) LaravelのキューのDBドライバー パフォーマンスに関しては最高ではないが、本番でも使えるレベルになっているとの こと I've tested the changes processing 516,783 jobs by 50 workers and it resulted no deadlocks. A production-ready database queue driver for Laravel - Diving Laravel https://divinglaravel.com/a-production-ready-database-queue-diver- for-laravel Nextat Inc. 57
選択肢4) PostgreSQLのLISTEN/NOTIFYを使う LISTEN / NOTIFY https://www.postgresql.org/docs/current/sql-listen.html https://www.postgresql.org/docs/current/sql-notify.html Pub/Subの仕組み 参考 PostgreSQL でメッセージキューイングを行う(LISTEN, NOTIFY) https://symfoware.blog.fc2.com/blog-entry-2519.html Do You Really Need Redis? How to Get Away with Just PostgreSQL https://spin.atomicobject.com/2021/02/04/redis-postgresql/ Nextat Inc. 58