Je app gaat viraal op TikTok.
Van 10 naar 100.000 gebruikers in één uur.
Wat gebeurt er met je ene VM? En wie betaalt de 20 VM's die je voor de zekerheid klaarzet… als de hype voorbij is?
Na deze les kan je:
| On-premises | IaaS (VM) | CaaS (containers) | PaaS | Serverless | |
|---|---|---|---|---|---|
| Hardware & netwerk | jij | provider | provider | provider | provider |
| Virtualisatie | jij | provider | provider | provider | provider |
| OS & patches | jij | jij | gedeeld | provider | provider |
| Runtime / container image | jij | jij | jij | provider | provider |
| Schalen & capaciteit | jij | jij | gedeeld | gedeeld | provider |
| Code, data & IAM-configuratie | jij | jij | jij | jij | jij |
| Je betaalt per… | aankoop | uur | uur / vCPU | plan / uur | request & ms |
Hoe verder naar rechts, hoe minder je beheert. Code, data en configuratie blijven altijd jouw verantwoordelijkheid.
Gebaseerd op: blog.james.rcpt.to – Evolution of compute: physical to serverlessServerless computing refers to the concept of building and running applications that do not require server management. […] Applications are executed, scaled, and billed in response to the exact demand needed at the moment.
Een serverless architectuur = FaaS als lijm tussen BaaS-bouwstenen, verbonden door events
| Type | Gedrag | AWS | GCP | Azure |
|---|---|---|---|---|
| Queue | 1 bericht → 1 consumer: werk verdelen | SQS | Cloud Tasks | Storage Queues, Service Bus queues |
| Pub/sub (topic) | 1 bericht → alle subscribers: fan-out | SNS | Pub/Sub | Service Bus topics |
| Event bus / router | routeert events op basis van regels en filters | EventBridge | Eventarc | Event Grid |
| Stream | geordende log, herleesbaar, hoge throughput | Kinesis, MSK Serverless | Managed Kafka, Pub/Sub (ordering keys) | Event Hubs |
In de praktijk combineer je ze, bv. EventBridge → SQS → Lambda.

def handle(event):
# al verwerkt? dan niets doen
if processed.exists(event["id"]):
return
create_invoice(event["data"])
processed.add(event["id"])
Vereenvoudigd: in productie gebruik je een conditionele write of transactie.
| Categorie | AWS | GCP | Azure |
|---|---|---|---|
| Functions | Lambda | Cloud Run functions | Azure Functions |
| Containers | Fargate (ECS/EKS) | Cloud Run | Container Apps |
| Object storage | S3 | Cloud Storage | Blob Storage |
| NoSQL database | DynamoDB | Firestore | Cosmos DB (serverless) |
| Relationele database | Aurora Serverless v2, Aurora DSQL | (Spanner met autoscaling) | Azure SQL Database serverless |
| Data warehouse | Redshift Serverless, Athena | BigQuery | Microsoft Fabric |
| Messaging | SQS, SNS, EventBridge | Pub/Sub, Eventarc | Service Bus, Event Grid |
| Orchestration | Step Functions | Workflows | Durable Functions, Logic Apps |
| API gateway | API Gateway | API Gateway, Apigee | API Management |
| Secrets | Secrets Manager | Secret Manager | Key Vault |
import functions_framework
@functions_framework.http
def hello(request):
name = request.args.get("name", "student")
return {"message": f"Hallo {name}!"}
def lambda_handler(event, context):
name = event.get("queryStringParameters",
{}).get("name", "student")
return {"statusCode": 200,
"body": f"Hallo {name}!"}
gcloud run deploy hello --source . --function hello \
--base-image python313 --region europe-west1 --allow-unauthenticated
CloudEvents: open CNCF-standaard voor het beschrijven van events (GCP Eventarc, Azure Event Grid)
{
"specversion": "1.0",
"type": "google.cloud.storage.object.v1.finalized",
"source": "//storage.googleapis.com/projects/_/buckets/videos-raw",
"id": "8413216547019243",
"time": "2026-09-28T09:30:00Z",
"datacontenttype": "application/json",
"data": { "bucket": "videos-raw", "name": "kat-op-skateboard.mp4" }
}
gcloud eventarc triggers create video-uploaded \
--location=europe-west1 \
--destination-run-service=transcoder \
--event-filters="type=google.cloud.storage.object.v1.finalized" \
--event-filters="bucket=videos-raw" \
--service-account=PROJECT_NUMBER-compute@developer.gserviceaccount.com
resource "google_cloud_run_v2_service" "api" {
name = "video-api"
location = "europe-west1"
template {
containers {
image = "europe-west1-docker.pkg.dev/my-proj/apps/video-api:1.0"
}
scaling {
min_instance_count = 0 # scale to zero
max_instance_count = 10 # kostenplafond!
}
}
}
| AWS Lambda | Cloud Run functions | Azure Functions (Flex Consumption) | |
|---|---|---|---|
| Max. uitvoeringstijd | 15 min | 60 min (HTTP) | 30 min standaard, configureerbaar |
| Max. geheugen | 10 GB | 32 GiB | tot 4 GB per instance |
| Requests per instance | 1 | tot 1000 (standaard 80) | configureerbaar |
| Scale to zero | ja | ja | ja |
Past je taak niet binnen deze grenzen? Kies dan een job (Cloud Run jobs, AWS Batch, Container Apps jobs) of een container.
Indicatieve waarden (stand 2026). Check altijd de actuele documentatie van de provider.Vuistregel: choreography tussen domeinen, orchestration voor een proces binnen één domein (bv. bestelling → betaling → verzending).
Betalen per gescande data of per verbruikte compute
Demo: BigQuery

Oneindig schaalbaar, betalen per GB, per request en voor egress. Vaak de bron van events.
Demo: GCP bucket

Demo!



kost = #requests × prijs per request
+ uitvoeringstijd × geheugen (GB-seconden) × prijs per GB-s
API-function: 512 MB geheugen, 200 ms per request
| Scenario | Requests / maand | GB-seconden | Lambda | Kleine VM('s), 24/7 |
|---|---|---|---|---|
| Schoolproject / interne tool | 5 miljoen | 500.000 | ≈ $2,50 (na free tier) | ≈ $15 |
| Constant 100 req/s | 259 miljoen | 25,9 miljoen | ≈ $480 | ≈ $60–120 |
Zet altijd budget alerts en max instances!
Les: niet "serverless is slecht", maar kies per workload het juiste model
Bron: Prime Video Tech blog – "Scaling up the Prime Video audio/video monitoring service and reducing costs by 90%" (2023)Opdracht: ontwerp een basic YouTube-alternatief, volledig serverless.
| Onderdeel | AWS | GCP | Azure |
|---|---|---|---|
| Auth | Cognito | Identity Platform / Firebase Auth | Entra External ID |
| API | API Gateway + Lambda | API Gateway + Cloud Run | API Management + Functions |
| Upload & opslag | S3 + presigned URL | Cloud Storage + signed URL | Blob Storage + SAS token |
| Upload-event | S3 → EventBridge | Eventarc | Event Grid |
| Transcoding | MediaConvert | Transcoder API / Cloud Run job | Container Apps job (FFmpeg) |
| Metadata & views | DynamoDB | Firestore | Cosmos DB |
| Distributie | CloudFront | Cloud CDN | Front Door |
| Events → datalake | Data Firehose → S3 + Athena | Pub/Sub → BigQuery | Event Hubs → Fabric |
| Aanbevelingen | Personalize / SageMaker | Vertex AI | Azure Machine Learning |
Serverless is geen doel, maar een keuze per workload
Volgende stap: aan de slag in het labo!