Cloud-Native Patterns
debt(d7/e7/b7/t5)
Closest to 'only careful code review or runtime testing' (d7). The detection_hints note automated=no, and while tools like docker, kubernetes, and twelve-factor linters can flag specific symptoms (local filesystem writes, config in files not env vars, missing health check endpoints), there is no single tool that comprehensively catches all cloud-native violations. Many issues — like missing SIGTERM handlers or slow startup — only surface under load or during scaling events, making them invisible until runtime.
Closest to 'cross-cutting refactor across the codebase' (e7). The quick_fix lists multiple simultaneous changes: externalising session/state storage to Redis/DB, switching logging to stdout, migrating all config to env vars, and adding graceful shutdown handling. Each of these touches different layers of the application — session management, logging infrastructure, configuration loading, and process lifecycle — and the common_mistakes confirm these are typically entrenched patterns spread across the codebase rather than isolated issues.
Closest to 'strong gravitational pull' (e7). The applies_to contexts include both web and cli, giving this choice wide reach. A non-cloud-native PHP app storing state locally or baking config into images shapes almost every future deployment, scaling, and CI/CD decision. As why_it_matters notes, horizontal scaling is blocked until these principles are adopted, meaning every infrastructure and feature decision is constrained by this foundational choice.
Closest to 'notable trap' (t5). The misconception field identifies a documented, commonly held wrong belief: that cloud-native means Kubernetes. Many developers conflate the orchestration platform with the design principles, leading them to either over-engineer (adopting Kubernetes prematurely) or dismiss cloud-native as irrelevant to their ECS/serverless setup. This is a well-documented gotcha rather than a catastrophic behavioural inversion, so t5 is appropriate.
Also Known As
TL;DR
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
Why It Matters
Common Mistakes
- Local file storage
- Config baked into images
- No graceful SIGTERM handling
- Slow startup delaying auto-scaling
Code Examples
$_SESSION['cart'] = $data; file_put_contents('/tmp/cache',$data);
ini_set('session.save_handler','redis'); ini_set('session.save_path',getenv('REDIS_URL'));
$s3->putObject(['Bucket'=>getenv('S3_BUCKET'),'Key'=>$path,'Body'=>$data]);