RousselTMLEARNING

Article · Cloud Computing: From Discovery to Expertise

Serverless computing

This article is available in French.

1. Qu'est-ce que le Serverless ? #

L'étape ultime de l'abstraction où le serveur devient invisible.

No-Ops ? #

Serverless ne signifie pas qu'il n'y a plus de serveurs, mais que vous n'avez plus à les gérer. Vous fournissez uniquement une fonction (FaaS) qui s'exécute en réponse à un événement (clic, upload de fichier, message dans une file).

2. Les avantages : Coût et Agilité #

Le coût est calculé au nombre d'exécutions et à la durée (souvent à la milliseconde près). Si votre code ne tourne pas, vous payez 0€. Cela permet une scalabilité instantanée de 1 à 10 000 requêtes par seconde.

3. Cas d'usage et limitations #

Idéal pour les APIs, le traitement d'images ou les tâches planifiées. Attention toutefois au 'Cold Start' (latence au premier démarrage) et aux limites de temps d'exécution (souvent 15 minutes max par fonction).

Mise en pratique : une fonction serverless #

Déployer et appeler une fonction.

Écrire et déployer #

Exécution d'une fonction serverless
Pas de serveur à gérer, mais des limites de durée et de démarrage à froid.
# handler.py
def handler(event, context):
    return {"statusCode": 200, "body": "Bonjour depuis le serverless"}

# AWS Lambda
zip function.zip handler.py
aws lambda create-function --function-name bonjour --runtime python3.12 --handler handler.handler \
  --zip-file fileb://function.zip --role arn:aws:iam::123456789012:role/lambda-role
aws lambda invoke --function-name bonjour out.json && cat out.json
aws logs tail /aws/lambda/bonjour --follow
# Google Cloud Functions / Azure Functions
gcloud functions deploy bonjour --gen2 --runtime=python312 --trigger-http --allow-unauthenticated --region=europe-west1
func init MonProjet --python && func new --name bonjour --template "HTTP trigger" && func start
Erreur Courante : Les cold starts (démarrage à froid), les limites de durée et le verrouillage fournisseur sont les trois pièges du serverless : mesurez la latence au premier appel.

📄 Le Serverless : L'informatique sans serveurs à gérer ↗

My progress

  • ⏱ Estimated time : ≈ 6 min

Sign in to track your progress and take notes. Sign in

✉️ Ask a question

Recommended Articles

License consumption types

Understand the evolution of billing in Dynatrace: the difference between the old licensing model ...

Grafana Alloy: The importance of Self-Monitoring

Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...

Grafana Alloy: Understanding and exploiting the User Interface (UI)

Discover how to enable, secure, and use Grafana Alloy's built-in web interface to visualize your ...

Grafana Alloy: Introduction and Architecture

Discover the fundamental concepts of Grafana Alloy, the transition from the static Agent to Alloy...

Grafana Alloy: Syntax and Configuration (Alloy Language: River)

As part of a Grafana training or observability training, master the declarative syntax of Grafana...

Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)

Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...

Grafana Alloy: Log Management with Loki

Discover how to configure Grafana Alloy to read log files, journald, or network streams, process ...

Grafana Alloy: Trace Management with Tempo

Dive into distributed trace processing. Learn how to ingest OTLP, Jaeger, or Zipkin traces with G...

Grafana Alloy: Continuous Profiling with Pyroscope

Discover how to configure continuous profiling in your environments using Grafana Alloy and Pyros...