Upgrade to Pro — share decks privately, control downloads, hide ads and more …

やるぞ!DBaaS x サーバーレスPHP / Let's do it! DBaaS x Serverless PHP

やるぞ!DBaaS x サーバーレスPHP / Let's do it! DBaaS x Serverless PHP

PHPカンファレンス北海道2024
https://phpcon.hokkaido.jp/

shiro seike

January 13, 2024
Tweet

More Decks by shiro seike

Other Decks in Programming

Transcript

  1. DBaaS x PHP PHP 2024 2 0 24 . 1

    . 12 @seike 4 60 1
  2. 自己 @seike 46 0 - - @seike 46 0 -

    AWS Community Builder Serverless - Fusic - / 門 - / - 月 PHP - PHP 2024 LT (Now ) - PHP 大 2024 LT - PHPerKaigi 20 2 4 LT - PHP 小 田 2024 - PHP 香 2024 - PHP 2024 2
  3. 4 ?

  4. 言 自 Cloud Native Computing Foundation 文 CNCF Serverless Whitepaper

    v 1 . 0 https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview 5
  5. FaaS 7 FaaS(Function as a Service) 心 AWS AWS Lambda

    Azure Azure Functions GCP Google Cloud Functions Google Cloud Run AWS Lamnda PHP 行
  6. 9

  7. 13

  8. Developer Community PR 18 service: app-php-serverless provider: name: aws region:

    ap-northeast- 1 plugins: - ./vendor/bref/bref functions: api: handler: index.php description: '' runtime: php- 83 -fpm timeout: 2 8 events: - httpApi: '*' # Exclude files from deployment package: patterns: - '!node_modules/**' - '!tests/**'
  9. AWS Lambda in production with Bref PHP Lovers Meetup vol.

    0 ~ <?php 2 0 23 . 7 . 10 @seike 4 60 2 0 Bref 方 見 https://speakerdeck.com/seike 46 0 /aws-lambda-in-production-with-bref
  10. supabase っPostgreSQL supabase PostgreSQL っ っ Google GitHub Facebook っ

    自 API SQL RESTful API 自 PostgREST 用 っ 行 っ 一 自 行 っ GitHub 用 -> EC 2 24
  11. Client OSS Client OSS Composer PostgREST PostgreSQL 用 RESTful API

    自 生 26 $ composer require supabase/postgrest-php
  12. Client 生 -> ORM 用 用 用   ORM  

    from 行 select insert update delete match like in 行 order limit 27
  13. 29

  14. 31

  15. Laravel x Bref 32 っServerless Framework $ npm install -g

    serverless $ serverless config credentials --provider aws --key " key" --secret " secret" っLaravel $ composer create-project laravel/laravel phpcondo っBref $ composer require bref/bref bref/laravel-bridge update-with-dependencies っ $ serverless deploy
  16. Laravel x Supabase 40 っ.env ?sslmode=require DB_CONNECTION=pgsql DATABASE_URL=postgresql://postgres:[YOUR-PASSWORD]@db.[YOUR-PROJECT- REF].supabase.co: 54

    3 2 /postgres?sslmode=require っphp/conf.d/php.ini Bref PostgreSQL extension=pdo_pgsql っmigration $ php artisan migrate
  17. 42

  18. 自己 @seike 46 0 - - @seike 46 0 -

    AWS Community Builder Serverless - Fusic - / 門 - / - 月 PHP 2024 - PHP 2024 LT (Done ) - PHP 大 2024 LT - PHPerKaigi 20 2 4 LT - PHP 小 田 2024 - PHP 香 2024 - PHP 2024 44