Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Serverless PHPの中身に迫る Brefの中身を覗いてみよう / A look in...
Search
shiro seike
PRO
September 16, 2023
Programming
1
660
Serverless PHPの中身に迫る Brefの中身を覗いてみよう / A look inside Serverless PHP Take a peek inside Bref
PHPカンファレンス沖縄2023
https://phpcon.okinawa.jp/
shiro seike
PRO
September 16, 2023
Tweet
Share
More Decks by shiro seike
See All by shiro seike
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
92
地方のPHPerもクラウドを使う理由 ~コストの最適化とチームに向き合う~ / Why even local PHPers use the cloud ~optimize costs and face the team
seike460
PRO
0
62
OpenTelemetryで始めるベンダーフリーなobservability / Vendor-free observability starting with OpenTelemetry
seike460
PRO
0
160
AIコーディングの本質は“コード“ではなく“構造“だった / The essence of AI coding is not “code” but "structure
seike460
PRO
2
910
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
1
620
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
280
Amazon Aurora DSQLパフォーマンスチェック / Amazon Aurora DSQL Performance Check
seike460
PRO
0
7
(再)ひとり技術広報からの脱却 / Re:Breaking away from one-man technical public relations
seike460
PRO
1
220
Amazon Q Developer Proで 効率化するAPI開発 / Streamline API Development with Amazon Q Developer Pro
seike460
PRO
0
6
Other Decks in Programming
See All in Programming
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
340
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
120
無関心の谷
kanayannet
0
160
業務自動化をJavaとSeleniumとAWS Lambdaで実現した方法
greenflagproject
1
100
Cline指示通りに動かない? AI小説エージェントで学ぶ指示書の書き方と自動アップデートの仕組み
kamomeashizawa
1
320
從零到一:搭建你的第一個 Observability 平台
blueswen
1
830
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfold' relates to 'iterate'"
philipschwarz
PRO
0
190
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
180
Agent Rules as Domain Parser
yodakeisuke
1
590
Zennの運営完全に理解した #完全に理解したTalk
wadayusuke
1
180
FastMCPでMCPサーバー/クライアントを構築してみる
ttnyt8701
2
130
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
750
Featured
See All Featured
How GitHub (no longer) Works
holman
314
140k
Adopting Sorbet at Scale
ufuk
77
9.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.3k
Agile that works and the tools we love
rasmusluckow
329
21k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Transcript
Serverless PHP Bref PHP 2023 2 0 23 .
9 . 16 @seike 4 60 1
@seike 46 0 - - @seike 46 0 - AWS
Community Builder Serverless - Fusic - / - / - - PHP - PHP - PHP - - 055538A - B 2 2
Agenda 1 .Serverless PHP 2 .Bref 3 .OSS 4 .Bref
5 . 3
01 Serverless PHP
Cloud Native Computing Foundation CNCF Serverless Whitepaper
v 1 . 0 https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview 5
FaaS 6 FaaS(Function as a Service) AWS AWS Lambda Azure
Azure Functions GCP Google Cloud Functions Google Cloud Run AWS Lamnda PHP
02 Bref
Bref Bref PHP OSS AWS Lambda PHP AWS Lambda PHP
PHP PHP Bref PHP PHP AWS Lambda Laravel Symfony PHP CLI 8
Developer Community AWS Lambda PHP PHP Deploy
PHPer Bref 9 service: app-phpcon-okinawa provider: name: aws region: ap-northeast- 1 plugins: - ./vendor/bref/bref functions: api: handler: index.php description: '' runtime: php- 8 2 -fpm timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds) events: - httpApi: '*' # Exclude files from deployment package: patterns: - '!node_modules/**' - '!tests/**' $ composer require bref/bref $ vendor/bin/bref init
10 HTTP Bref Pull PHP Bref
03 OSS
OSS 12 Bref OSS OSS OSS Bref GitHub Class
04 Bref
runtime 14
Runtime README 15
brefphp/aws-lambda-layers runtime php- 83 16
Dockerfile bootstrap bootstrap AWS Lambda 17
bootstrap RUNTIME_CLASS Class run 18
GitHub php-fpm 19
run() php-fpm processNextEvent Php-fpm Event 20
Invoke HTTP Invoke HTTP 21
HTTP Handler HTTP Handler handle 22
Response HTTP Request Object Request handling response API Gateway
Response 23
HTTP Request Event QueryString header 24
toApiGatewayFormat API Gateway ⾒ Cookie header Body 25
26 Bref AWS Lambda API Gateway Bref AWS
Lambda AWS APIGatewayV 2 HTTPEvent Bref Lambda
Coverage by Bref 27 Bref AWS
04
29 Bref PHP Point 1 Bref Event PHP Point 2
AWS Point 3 Point 4
Thank You We are Hiring ! https://recruit.fusic.co.jp/