Google: Serverless Application Architecture
severless workshop
Serverless code runs on demand. - when there is no work it goes away
Serverless code is stateless - when it goes away, so does the memory and file system.
Serverless code scales on demand.
- Most applications need state :: require external storage
- Events are handled by the platform :: which then invokes your code, once event is handled code stops
- The application is now a cooperating collection of pieces
Google Cloud Serverless (Compute) options:
- App engine :: useful as a web app backend
- Cloud Functions :: Good fit for small, focussed event handlers
- Cloud Run :: Container based, therefore is very flexible
Blog post on serverless website that runs pascal here
Cloud functions are the shortest path to have live code online.
Google Cloud Serverless (State) options:
- Cloud Firestore
- Firestore in Datastore Mode
- Cloud Storage
Some event sources:
- Web requests
- Updated data
- Tasks, Scheduler, Pub/Sub
Basic Serverless Example
To do list
One list.
One or multiple users use 1 list.
Serverless approach:
- State - list of items
- Events - Web requests: GET, POST, DELETE, PUT
App engine has the ability to use Identity Aware proxy so not everyone can access the app.