Cloud-Native Patterns
Also Known As
cloud native
12-factor
stateless services
TL;DR
Stateless services, externalised config, health checks, graceful shutdown, and immutable infrastructure — the 12-Factor App extended for containers.
Explanation
Stateless processes (sessions in Redis, files in S3), externalised config (env vars, never baked in images), immutable infrastructure (replace not patch), disposability (fast startup <10s, graceful SIGTERM), health checks (readiness+liveness), structured logging to stdout, horizontal scaling.
Common Misconception
✗ Cloud-native requires Kubernetes — it is a set of design principles; a PHP app on ECS Fargate can be fully cloud-native.
Why It Matters
A PHP application storing sessions on local disk cannot be horizontally scaled — cloud-native stateless design enables auto-scaling.
Common Mistakes
- Local file storage
- Config baked into images
- No graceful SIGTERM handling
- Slow startup delaying auto-scaling
Code Examples
✗ Vulnerable
$_SESSION['cart'] = $data; file_put_contents('/tmp/cache',$data);
✓ Fixed
ini_set('session.save_handler','redis'); ini_set('session.save_path',getenv('REDIS_URL'));
$s3->putObject(['Bucket'=>getenv('S3_BUCKET'),'Key'=>$path,'Body'=>$data]);
References
Tags
🤝 Adopt this term
£79/year · your link shown here
Added
16 Mar 2026
Edited
22 Mar 2026
Views
25
🤖 AI Guestbook educational data only
|
|
Last 30 days
Agents 1
No pings yesterday
Amazonbot 8
Perplexity 6
Google 2
Unknown AI 2
Ahrefs 2
SEMrush 1
Also referenced
How they use it
crawler 20
crawler_json 1
Related categories
⚡
DEV INTEL
Tools & Severity
🟡 Medium
⚙ Fix effort: High
⚡ Quick Fix
PHP apps become cloud-native by: storing state externally (Redis/DB), logging to stdout, reading config from env vars, and handling SIGTERM for graceful shutdown
📦 Applies To
PHP 5.0+
web
cli
🔍 Detection Hints
PHP writing to local filesystem; config in files not env vars; no SIGTERM handler; health check endpoint missing
Auto-detectable:
✗ No
docker
kubernetes
twelve-factor
⚠ Related Problems
🤖 AI Agent
Confidence: Low
False Positives: High
✗ Manual fix
Fix: High
Context: File