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
2018-06-22-RomaniaPHP-Introduction-to-Serverles...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Rob Allen
June 10, 2018
290
0
Share
2018-06-22-RomaniaPHP-Introduction-to-Serverless-PHP.pdf
Rob Allen
June 10, 2018
More Decks by Rob Allen
See All by Rob Allen
Introduction to Serverless PHP
akrabat
0
110
HTTP & Middleware
akrabat
0
460
5 Features of a Good API
akrabat
1
540
The Serverless Way
akrabat
2
240
Introducing OpenWhisk
akrabat
1
390
The Serverless Way
akrabat
1
350
Introduction to Serverless PHP
akrabat
0
800
Writing APIs in Lumen
akrabat
0
760
Test
akrabat
0
120
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
So, you think you're a good person
axbom
PRO
2
2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Ruling the World: When Life Gets Gamed
codingconduct
0
220
Color Theory Basics | Prateek | Gurzu
gurzu
0
300
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
170
Skip the Path - Find Your Career Trail
mkilby
1
110
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
290
Product Roadmaps are Hard
iamctodd
PRO
55
12k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
110
Making Projects Easy
brettharned
120
6.6k
Transcript
Introduction to Serverless PHP Rob Allen June 2018
Deployment options 1. Physical servers 2. Virtual machines 3. Containers
Rob Allen ~ @akrabat
Container deployments 1. Platform (e.g. Kubernetes) 2. Application (e.g. Cloud
Foundry) 3. Serverless (e.g. OpenWhisk) Rob Allen ~ @akrabat
Serverless? The first thing to know about serverless computing is
that "serverless" is a pretty bad name to call it. - Brandon Butler, Network World Rob Allen ~ @akrabat
AKA: Functions as a Service • A runtime to execute
your functions • No capacity planning or load balancing; just tasks being executed. • Pay for execution, not when idle Rob Allen ~ @akrabat
Use-cases Synchronous Service is invoked and provides immediate response (HTTP
requests: APIs, chat bots) Asynchronous Push a message which drives an action later (web hooks, timed events, database changes) Streaming Continuous data flow to be processed Rob Allen ~ @akrabat
Benefits • No need to think about servers • Concentrate
on application code • Pay only for what you use, when you use it • Language agnostic: NodeJS, Swift, Python, Java, C#, etc Rob Allen ~ @akrabat
Challenges • Start up latency • Time limit • State
is external • DevOps is still a thing Rob Allen ~ @akrabat
It's about value Rob Allen ~ @akrabat
When should you use serverless? • Occasional server needs on
a static site • Variable traffic levels • Additional compute without extending current platform • Responding to web hooks Rob Allen ~ @akrabat
Serverless providers Rob Allen ~ @akrabat
OpenWhisk Rob Allen ~ @akrabat
OpenWhisk OpenSource; multiple providers: IBM RedHat Adobe (for Adobe Cloud
Platform APIs) &, of course, self-hosted Rob Allen ~ @akrabat
Invoking an action Rob Allen ~ @akrabat
Serverless PHP Rob Allen ~ @akrabat
Hello world in PHP Rob Allen ~ @akrabat
Hello world in PHP Rob Allen ~ @akrabat
Running your action $ wsk action update hello hello.php ok:
updated action hello $ wsk action invoke hello --result { "msg": "Hello World" } Rob Allen ~ @akrabat
Dependencies Zip them up $ zip -r hello.zip hello.php vendor
$ wsk action update hello hello.zip --kind php:7.1 Rob Allen ~ @akrabat
Web access Add the --web flag: $ wsk action update
hello hello.php --web true $ curl https://openwhisk.ng.bluemix.net/api/v1/web/ \ 19FT_demo/default/hello.json Rob Allen ~ @akrabat
What to do in your action • Compute! • Store
to database • Make API calls to other services • Store to cloud storage (S3) • Trigger other actions Rob Allen ~ @akrabat
Demo time! Rob Allen ~ @akrabat
To sum up Rob Allen ~ @akrabat
Resources • http://www.openwhisk.org • https://medium.com/openwhisk • https://github.com/akrabat/ow-php-ftime • https://www.martinfowler.com/articles/serverless.html Rob
Allen ~ @akrabat
Questions? Rob Allen ~ @akrabat
Thank you! Rob Allen ~ @akrabat