- Chapter
- Chapter 1 — Cloud-Native Architecture
- Prerequisites
- Volumes I–VI of Book 9
- You will be able to
- Explain cloud-native principles and their trade-offs, assess a system's cloud-native maturity, choose migration strategies, avoid common anti-patterns, adapt Java services for cloud-native runtimes, and decide when a cloud-native design is not justified
- Covers
- Cloud-native principles
On this page
- 1. Concept / Definition
- 2. Why It Exists
- 3. Core Concepts — Cloud-Native Principles
- 4. How It Works Internally — The Cloud-Native Runtime Loop
- 4A. Deep Dive — Migration Strategies (the 6 Rs)
- 4B. Deep Dive — Anti-Patterns
- 4C. Deep Dive — Java in Cloud-Native Runtimes
- 4D. Deep Dive — Organisation and Operating Model
- 4E. Deep Dive — When Not to Go (Fully) Cloud-Native
- 5. APIs / Features / Syntax
- 6. Practical Examples
- 7. Common Problems & Mistakes
- 8. Performance & Production Considerations
- 9. Architecture & Design Considerations
- 10. Interview Questions & Answers
1Concept / Definition
Cloud-native architecture builds and runs applications to exploit the cloud's operating model: on-demand elastic resources, automation through APIs, managed services and global infrastructure. The CNCF describes cloud-native systems as scalable applications in dynamic environments, built with containers, service meshes, microservices, immutable infrastructure and declarative APIs, and made resilient, manageable and observable through automation.


| Vocabulary | Meaning |
|---|---|
| Elasticity | Scaling out and in automatically with demand |
| Declarative management | Describe desired state; controllers converge to it |
| Cattle vs pets | Replaceable instances vs hand-maintained servers |
| Distributed monolith | Microservices so coupled they must deploy together |
2Why It Exists
| Traditional constraint | Cloud-native response |
|---|---|
| Hardware bought for peak, idle most of the year | Elastic scaling, pay per use |
| Weeks to provision environments | API-driven infrastructure in minutes |
| Big releases, rare deploys | Independent services, continuous delivery |
| Failures handled manually | Self-healing orchestration |
| Scaling limited by one big database/server | Horizontal scale, partitioning, managed services |

3Core Concepts — Cloud-Native Principles
| Principle | Meaning | ShopNow practice |
|---|---|---|
| Design for failure | Any component can fail at any time | Timeouts, retries with budgets, circuit breakers, multi-AZ |
| Elasticity | Scale with demand | HPA/KEDA, Karpenter, Aurora Serverless for spiky workloads |
| Statelessness | State lives in backing services | JWT sessions, Redis/DynamoDB, no local disk state |
| Loose coupling | Services evolve independently | Events, versioned APIs, consumer-driven contracts |
| API-first | Contracts before code | OpenAPI/AsyncAPI in repos |
| Declarative | Desired state in Git | GitOps, Terraform, ACK |
| Automation | No manual repetitive work | Pipelines, runbook automation |
| Observability | Telemetry by default | OTel in golden path |
| Security by default | Least privilege, zero trust | IRSA, mTLS, policies |
| Cost awareness | Cost is an architecture metric | Unit cost per order, FinOps dashboards |
4How It Works Internally — The Cloud-Native Runtime Loop
| Layer | Mechanism |
|---|---|
| Desired state | Git (manifests, Terraform) |
| Controllers | Kubernetes, Argo CD, Karpenter, ACK reconcile continuously |
| Health | Probes, SLOs, autoscalers react to metrics |
| Replacement | Failed pods/nodes replaced automatically |
| Change | New immutable versions rolled out progressively |
| Feedback | Telemetry drives scaling, rollback and learning |
4ADeep Dive — Migration Strategies (the 6 Rs)
| Strategy | Description | When |
|---|---|---|
| Rehost (lift-and-shift) | Move VMs as-is | Deadline-driven data-centre exit |
| Replatform (lift-tinker-shift) | Swap components (RDS for self-managed DB) | Quick wins |
| Refactor / re-architect | Redesign as cloud-native services | Core differentiating systems |
| Repurchase | Replace with SaaS | Commodity capabilities (HR, CRM) |
| Retain | Keep on-prem for now | Regulated/core banking (NovaBank) |
| Retire | Switch off | Unused applications |
4BDeep Dive — Anti-Patterns
| Anti-pattern | Symptom | Fix |
|---|---|---|
| Distributed monolith | Lock-step deploys, shared DB | Bounded contexts, owned data |
| Chatty services | 20 synchronous calls per request | Coarser APIs, aggregation, events |
| Lift-and-shift then "done" | Same costs, same outages | Replatform/refactor roadmap |
| Kubernetes for everything | Ops burden for simple workloads | Serverless/managed where fitting |
| Snowflake environments | Drift, "works in staging" | Immutable, IaC |
| Ignoring cost | Cloud bill surprises | FinOps, unit economics |
4CDeep Dive — Java in Cloud-Native Runtimes
| Concern | Java 25 / Spring Boot 4 approach |
|---|---|
| Startup time for scaling | CDS/AOT cache, Spring AOT; CRaC for checkpoint/restore; GraalVM native image for functions/CLI |
| Memory footprint | Container-aware JVM (-XX:MaxRAMPercentage), right-sized heaps |
| Concurrency | Virtual threads for blocking I/O at scale |
| Graceful shutdown | server.shutdown=graceful + preStop hook |
| Configuration | Spring profiles + env/ConfigMaps, no rebuilds per env |
| Health | Actuator liveness/readiness groups |
4DDeep Dive — Organisation and Operating Model
| Element | Cloud-native practice |
|---|---|
| Team structure | Stream-aligned teams owning services end to end |
| Platform | Platform team provides golden paths (Volume IV) |
| Ownership | You build it, you run it |
| Governance | Guardrails as code, not approval boards |
| Skills | Engineers comfortable with IaC, Kubernetes, observability |
4EDeep Dive — When Not to Go (Fully) Cloud-Native
| Situation | Better choice |
|---|---|
| Small team, simple app | Modular monolith on a PaaS/serverless |
| Stable, rarely changed back office | Rehost or retain |
| Hard real-time/latency on specialised hardware | Specialised infrastructure |
| Regulatory constraints on data location/control | Hybrid (NovaBank core banking) |
| Very steady load at huge scale | Reserved capacity; cost modelling |
5APIs / Features / Syntax
# Cloud-native Deployment essentials: probes, graceful shutdown, resources, spread
apiVersion: apps/v1
kind: Deployment
metadata: { name: catalog, labels: { app: catalog } }
spec:
replicas: 6
selector: { matchLabels: { app: catalog } }
template:
metadata: { labels: { app: catalog } }
spec:
terminationGracePeriodSeconds: 40
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector: { matchLabels: { app: catalog } }
containers:
- name: app
image: 111122223333.dkr.ecr.ap-south-1.amazonaws.com/catalog@sha256:4be1...
resources: { requests: { cpu: 500m, memory: 1Gi }, limits: { memory: 1Gi } }
env: [{ name: JAVA_TOOL_OPTIONS, value: "-XX:MaxRAMPercentage=75" }]
readinessProbe: { httpGet: { path: /actuator/health/readiness, port: 8081 } }
livenessProbe: { httpGet: { path: /actuator/health/liveness, port: 8081 } }
lifecycle: { preStop: { sleep: { seconds: 10 } } }# application.yaml — cloud-friendly Spring Boot 4 defaults
server:
shutdown: graceful
spring:
threads.virtual.enabled: true
lifecycle.timeout-per-shutdown-phase: 25s
management:
endpoint.health.probes.enabled: true# Faster JVM startup for scale-out: build an AOT cache (JEP 483/514) during image build
java -XX:AOTCacheOutput=app.aot -Dspring.context.exit=onRefresh -jar app.jar
# runtime
java -XX:AOTCache=app.aot -jar app.jar6Practical Examples
6.1 ShopNow from VMs to platform
In 2019 ShopNow ran a monolith on 40 VMs with monthly releases. Containerisation, EKS, GitOps and a platform team took it to ~160 service deploys per day with automated scaling for sale events.
6.2 Distributed monolith undone
Early microservices shared one database and deployed together. Splitting data ownership and introducing events allowed independent releases; lock-step deploys dropped from weekly to never.
6.3 NovaBank hybrid choice
NovaBank retained core banking on-prem (regulation, vendor platform) while building digital channels cloud-native — a deliberate "retain + refactor" mix.
6.4 Worked example — maturity assessment
Scenario. Two years into its cloud migration, ShopNow's leadership asked how "cloud-native" the platform really was and where to invest next.
| Dimension | Level (1–5) |
|---|---|
| Delivery automation | 4 |
| Elasticity | 4 |
| Resilience | 3 |
| Observability | 4 |
| Cost management | 2 |
What it shows. A maturity assessment scores each dimension from 1 to 5. Delivery automation scored 4, because most services deploy automatically; elasticity scored 4; resilience only 3, because failover had not been tested regularly; observability 4. The lowest score pointed to the next investment: regular resilience testing and automated failover. A year later, resilience reached 4 after monthly game days were introduced. Because each score came with evidence, such as deployment logs and incident records, leadership trusted the results and funded the gaps without long debate.
Common mistake. Scoring maturity once and filing the report. Without repeated assessments, nobody knows whether investments worked.
Takeaway. Assess cloud-native maturity by dimension, and invest first where scores are lowest.
6.5 Worked example — statelessness check
Scenario. ShopNow wanted checkout pods to scale freely, but some state still lived inside them.
| State | Location |
|---|---|
| User session | JWT + Redis |
| Uploads | S3 (presigned) |
| Scheduled jobs | Leader election / Kubernetes CronJobs |
What it shows. The statelessness check lists every kind of state and where it now lives. User sessions are carried in JWTs with Redis for server-side data. Uploads go directly to S3 using presigned URLs, so they never touch the pod's disk. Scheduled jobs use leader election, so only one pod runs each job. With no state left in pods, any pod can be added, removed or replaced at any time. The team proved it by terminating random pods during peak traffic: no user lost a session, an upload or a scheduled job.
Common mistake. Moving most state out but leaving one piece, such as a local file cache. That single dependency still breaks scaling and restarts.
Takeaway. Inventory every kind of state and move it out of application instances before relying on elasticity.
6.6 Worked example — cost awareness
Scenario. ShopNow's cloud costs grew along with orders, and finance asked whether the platform was becoming more or less efficient.
| Metric | Value |
|---|---|
| Infra cost per order | ₹3.20 (target ₹3.00) |
What it shows. Infrastructure cost per order, ₹3.20 against a target of ₹3.00, connects cloud spend to business volume. Tracked monthly, it shows whether growth is efficient. The gap of ₹0.20 led to rightsizing over-provisioned services and moving batch work to Spot, which brought the figure to target within two quarters. Publishing the figure on the team dashboard also changed behaviour, because engineers could now see the cost effect of their own design choices.
Common mistake. Looking only at the total bill, which rises with healthy growth and hides inefficiency.
Takeaway. Track unit cost as a cloud-native KPI so efficiency is visible as the business grows.
6.7 Worked example — interview whiteboard
Scenario. In interviews, ShopNow asks, "What makes an architecture cloud-native?"
| Prompt | Answer outline |
|---|---|
| "What makes an architecture cloud-native?" | "Operating model that exploits elasticity, automation and managed services: independently deployable services with owned data; containers orchestrated declaratively with self-healing; stateless processes with state in backing services; design for failure (timeouts, retries, circuit breakers, multi-AZ); CI/CD and GitOps; observability and security by default; cost as a metric. Choose migration strategy per system (6Rs); avoid distributed monoliths and chatty designs; tune the JVM for containers and fast startup; organise teams around services with a platform team; don't over-apply where a simpler model fits." |
Why it works. The outline describes cloud-native as an operating model that exploits elasticity, automation and managed services and expects failure. It names the building blocks, such as independent services, containers, declarative infrastructure, observability and resilience patterns, and connects them to outcomes like frequent deployment and fast recovery. It also states when cloud-native is not worth it. Interviewers also value a candidate who mentions organisational change, because cloud-native depends as much on team ownership as on technology.
Common mistake. Answering "it runs on Kubernetes". Infrastructure choice alone does not make a system cloud-native.
Takeaway. Explain cloud-native as an operating model with clear outcomes, not as a technology list.
6.8 Worked example — PayGrid cells
Scenario. PayGrid needed to limit the impact of any single failure on its merchants.
| Principle | Application |
|---|---|
| Design for failure + blast radius | Independent cells, automated cell provisioning |
What it shows. PayGrid applies "design for failure" and "limit blast radius" through independent cells: each cell is a complete copy of the platform serving a subset of merchants, and new cells are provisioned automatically from code. A failure or bad deployment affects only one cell. During a later incident, only 12% of merchants were affected, and they were moved to a healthy cell within minutes. Each cell also has its own deployment pipeline, so a new release goes to one canary cell first and reaches the others only after it proves healthy.
Common mistake. Sharing databases or queues between cells, which quietly reconnects their failure domains.
Takeaway. Use cells to contain failures, and keep them truly independent.
6.9 Worked example — anti-patterns
Scenario. ShopNow's Kubernetes clusters had become difficult to manage, despite being "cloud-native" on paper.
| Anti-pattern | Effect |
|---|---|
| Pets in Kubernetes (manual kubectl edits) | Drift |
| Autoscaling without capacity planning | Downstream overload |
| Ignoring JVM container limits | OOM kills |
What it shows. The table lists anti-patterns. Treating pods and clusters as pets, edited manually with kubectl, causes drift between environments. Relying on autoscaling without capacity planning fails when quotas or databases are reached. ShopNow moved all changes into Git with GitOps and added capacity planning for shared resources, after which configuration drift disappeared. The team also began reviewing cluster changes the same way as code, which made the platform's behaviour predictable again.
Common mistake. Adopting cloud-native tools while keeping old manual habits.
Takeaway. Change practices, not just platforms: manage everything declaratively and plan capacity for shared limits.
6.10 Worked example — elasticity in numbers
Scenario. ShopNow's finance team doubted that elasticity made much difference to cost.
| Time | Checkout pods |
|---|---|
| 03:00 | 12 |
| 20:00 sale | 74 |
What it shows. The numbers made it concrete. Checkout ran 12 pods at 03:00 and 74 during the 20:00 sale. A fixed deployment sized for the peak would have paid for 74 pods all day. With autoscaling, ShopNow paid for roughly the average, cutting checkout compute cost by more than half. The savings were even larger for services with sharper peaks, which persuaded finance to fund autoscaling work for the rest of the platform.
Common mistake. Setting the minimum replica count close to peak "to be safe", which removes most of the savings.
Takeaway. Let capacity follow demand, and set minimums based on real low-traffic needs.
6.11 Worked example — self-healing
Scenario. ShopNow's on-call engineers were woken up for failures that the platform could have handled automatically.
| Failure | Automatic response |
|---|---|
| Pod crash | Restart |
| Node failure | Reschedule, Karpenter replaces node |
| AZ impairment | Zonal shift |
What it shows. The table maps failures to automatic responses. A crashed pod is restarted. A failed node has its pods rescheduled, and Karpenter launches a replacement node. An availability-zone problem shifts traffic to healthy zones. After enabling these responses and adjusting alerts, night-time pages for routine failures fell sharply. Each automatic response is tested regularly, so the team knows it works before a real failure depends on it.
Common mistake. Alerting humans for every failure, including ones the platform already fixed.
Takeaway. Let the platform heal routine failures automatically, and page people only when automation cannot help.
6.12 Worked example — API-first
Scenario. ShopNow's frontend and backend teams for a new feature kept waiting for each other.
| Artifact | Use |
|---|---|
| OpenAPI spec reviewed before implementation | Parallel frontend/backend work |
What it shows. With an API-first approach, the OpenAPI specification is written and reviewed before implementation. The frontend team builds against a mock generated from the spec while the backend team implements it. Both finish in parallel, and the integration works the first time because the contract was agreed up front. The specification also became the source for client SDKs, contract tests and documentation, so they always matched the real API.
Common mistake. Writing the specification after the code, so it documents whatever happened rather than guiding work.
Takeaway. Agree API contracts first so teams can work in parallel with fewer surprises.
6.13 Worked example — declarative vs imperative
Scenario. During an incident, an engineer scaled a deployment manually with kubectl, and the change was lost at the next deployment.
| Imperative | Declarative |
|---|---|
| "kubectl scale --replicas=10" | replicas in Git, HPA bounds |
What it shows. The imperative command kubectl scale --replicas=10 changes the live state only. In a declarative model, replicas and HorizontalPodAutoscaler bounds are stored in Git, and the platform continuously converges to them. ShopNow now changes scaling limits in Git, so changes are reviewed, recorded and never silently reverted. When an emergency change is truly needed, the team now makes it through a fast-tracked pull request, which keeps speed without losing the record.
Common mistake. Mixing manual changes with GitOps, which leads to confusing reversions and drift.
Takeaway. Manage desired state declaratively in version control, and let controllers converge to it.
6.14 Worked example — CRaC for fast scale-out
Scenario. During sudden traffic spikes, new checkout pods took 14 seconds to become ready, so users saw slow responses before capacity arrived.
| Metric | Before | After |
|---|---|---|
| Startup to ready | 14 s | 0.8 s |
What it shows. Using CRaC, coordinated restore at checkpoint, the JVM starts from a saved snapshot of a warmed-up application. Start-up to ready dropped from 14 seconds to 0.8 seconds. Autoscaling now reacts almost immediately to spikes. The warmed-up snapshot also meant the first requests after scaling were fast, because the JIT compiler had already optimised the hot code paths.
Common mistake. Ignoring start-up time when designing for elasticity. Slow start-up makes autoscaling too late to help.
Takeaway. Reduce start-up time, with techniques such as CRaC, AOT caches or native images, so elasticity works in practice.
6.15 Worked example — serverless fit
Scenario. ShopNow debated whether to move everything to serverless.
| Workload | Choice |
|---|---|
| Image thumbnailing | Lambda |
| Checkout | EKS |
What it shows. The answer depends on the workload. Image thumbnailing is event-driven, bursty and short, so Lambda fits well. Checkout is long-running, latency-sensitive and steady at scale, so it stays on EKS. Choosing per workload gave both cost savings and predictable performance. The team revisits the choice when a workload changes, for example when a batch job grows into a steady stream of work.
Common mistake. Choosing one runtime for everything, either all serverless or all containers.
Takeaway. Pick the runtime that fits each workload's traffic pattern and latency needs.
6.16 Worked example — interview follow-ups
Scenario. In interviews, ShopNow asks follow-up questions about cloud-native architecture.
| Follow-up | Answer |
|---|---|
| "Is Kubernetes required?" | No — containers, serverless or PaaS can all be cloud-native |
| "Biggest risk?" | Distributed complexity without automation and observability |
Why it works. Typical follow-ups have crisp answers. Is Kubernetes required? No; containers on PaaS, serverless or managed platforms can all be cloud-native if they meet the principles. Is cloud-native always better? No; small or stable systems may not justify the complexity. Strong candidates support each answer with a short example from their own experience, which shows judgement rather than memorised definitions.
Common mistake. Equating cloud-native with one specific technology.
Takeaway. Show that cloud-native is about principles and trade-offs, not a single platform.
6.17 Worked example — checklist
Scenario. ShopNow reviews new services against a cloud-native checklist before launch.
| Item | ✔ |
|---|---|
| Independent services + owned data | ✔ |
| Stateless processes | ✔ |
| Declarative infra + GitOps | ✔ |
| Design for failure | ✔ |
| Observability + security defaults | ✔ |
| Cost metrics | ✔ |
What it shows. The checklist confirms independent services with owned data, stateless processes, declarative infrastructure with GitOps, observability and resilience patterns. Services that fail an item receive specific improvement actions before reaching tier-1 status. Over time, ShopNow also ran the checklist against older services and turned the gaps into a prioritised improvement backlog.
Common mistake. Applying the checklist to new services only, while legacy services stay unchanged.
Takeaway. Use a cloud-native checklist for both new and existing services, and track improvements.
6.18 Worked example — team topology
Scenario. ShopNow's teams were overwhelmed by the responsibility of running their own services on a complex platform.
| Team | Role |
|---|---|
| Stream-aligned (checkout) | Own service lifecycle |
| Platform | Golden paths |
| Enabling (SRE) | Reliability practices |
What it shows. Team topology spreads responsibility sensibly. Stream-aligned teams, such as checkout, own their service's full life cycle. The platform team provides golden paths, such as templates and pipelines. An enabling SRE team helps with reliability practices. Teams kept ownership while cognitive load dropped. Onboarding new engineers also became faster, because golden paths showed them one well-supported way to build and run a service.
Common mistake. Expecting every team to master the whole platform without support.
Takeaway. Organise teams so ownership is clear and supported by platform and enabling teams.
6.19 Worked example — failure injection culture
Scenario. ShopNow's architecture claimed to tolerate pod and zone failures, but this had never been proven.
| Practice | Frequency |
|---|---|
| Pod/AZ chaos in staging | Weekly/monthly |
What it shows. Failure injection runs regularly: pod-level chaos weekly and zone-level chaos monthly in staging. The first zone test revealed that a service pinned its database connections to one zone, which was fixed. Regular injection now proves that design for failure works. Each experiment has a clear hypothesis, a limited blast radius and a stop condition, so it teaches the team without risking customers.
Common mistake. Running chaos experiments only once, or only in production without preparation.
Takeaway. Inject failures regularly in safe environments to prove resilience claims.
6.20 Worked example — portability
Scenario. ShopNow's leadership worried about being locked into AWS by cloud-native choices.
| Choice | Portability |
|---|---|
| Kubernetes APIs, OTel, OCI images | High |
| DynamoDB, Step Functions | Lower (accepted for value) |
What it shows. The table shows portability by choice. Kubernetes APIs, OpenTelemetry and OCI images are highly portable. DynamoDB and Step Functions are less portable, but ShopNow accepted that for their value, recording the decision and an exit estimate in ADRs. Writing down the exit cost turned a vague fear of lock-in into a concrete, reviewable trade-off that leadership could accept knowingly.
Common mistake. Avoiding all managed services for portability, which increases operational cost greatly.
Takeaway. Make portability decisions explicitly per component, balancing lock-in against value.
6.21 Worked example — interview scenario
Scenario. In an interview, ShopNow asks: "Leadership wants to go cloud-native in six months. What do you do?"
| Question | Answer |
|---|---|
| "Leadership wants to 'go cloud-native' in 6 months" | Assess portfolio, 6Rs per app, platform first, incremental refactoring |
Why it works. A strong answer assesses the application portfolio, decides one of the 6 Rs for each application, such as rehost, replatform or refactor, plans waves starting with high-value candidates and builds platform foundations first. It sets realistic expectations: six months can deliver foundations and early wins, not full transformation. Interviewers also look for how the candidate would measure progress and communicate trade-offs to leadership during the six months.
Common mistake. Promising to refactor everything quickly, which usually fails.
Takeaway. Answer with a portfolio-based plan and honest expectations.
6.22 Worked example — cloud-native metrics
Scenario. ShopNow wanted to measure whether becoming cloud-native improved outcomes.
| Metric | Target |
|---|---|
| Deployment frequency | Daily per service |
| MTTR | < 30 min |
| Infra provisioning | Self-service |
What it shows. The metrics include daily deployments per service, mean time to restore under 30 minutes, self-service provisioning of infrastructure, and unit cost. Tracking them quarterly showed steady improvement in deployment frequency and recovery time. Sharing the metrics with teams also helped them spot where they were falling behind and ask the platform team for targeted help.
Common mistake. Measuring cloud-native progress by the number of services migrated rather than by outcomes.
Takeaway. Measure cloud-native success through delivery speed, recovery time and unit cost.
6.23 Worked example — graceful shutdown sequence
Scenario. ShopNow's deployments caused small bursts of errors as pods stopped.
| Step | Detail |
|---|---|
| preStop sleep 10 s | LB deregistration |
| Stop accepting, finish in-flight (25 s) | No dropped requests |
What it shows. The graceful shutdown sequence fixes this. A preStop sleep of ten seconds lets the load balancer deregister the pod. The application then stops accepting new requests and finishes in-flight work within 25 seconds before exiting. Deployment errors dropped to zero. The same behaviour also made node replacements and autoscaling scale-downs safe, because pods always finished their work before stopping.
Common mistake. Relying on default shutdown behaviour, which stops containers immediately.
Takeaway. Configure graceful shutdown so scaling and deployments are invisible to users.
6.24 Worked example — config per environment
Scenario. ShopNow built separate container images for each environment, and bugs appeared in production that were not in staging.
| Environment | Mechanism |
|---|---|
| dev/staging/prod | Same image, Kustomize overlays + Secrets |
What it shows. Now the same image runs in development, staging and production, with differences applied through Kustomize overlays and Secrets. What is tested is exactly what runs in production, and environment-specific bugs fell sharply. Promotions also became simpler, because moving a release to production meant changing only an image tag in Git.
Common mistake. Rebuilding images per environment, which means production runs untested artefacts.
Takeaway. Build once, configure per environment.
6.25 Worked example — cloud-native for batch
Scenario. ShopNow's nightly batch jobs ran on fixed servers that sat idle most of the day.
| Pattern | Detail |
|---|---|
| Kubernetes Jobs / AWS Batch with Spot | Elastic, cheap batch |
What it shows. Cloud-native principles apply to batch too. Kubernetes Jobs or AWS Batch run work on demand, using Spot capacity for cost savings, and scale to zero when idle. Batch costs fell by about 70%, and jobs finished faster because they could use more capacity in parallel. Because jobs are now defined as code, failed runs can be retried automatically and every run leaves logs and metrics for review.
Common mistake. Assuming cloud-native applies only to web services.
Takeaway. Apply elasticity and automation to batch workloads as well as online services.
7Common Problems & Mistakes
| Mistake | Fix |
|---|---|
| Lift-and-shift only | Refactor roadmap |
| Distributed monolith | Bounded contexts |
| No automation | IaC, GitOps |
| Cost blindness | FinOps |
8Performance & Production Considerations
| Consideration | Practice |
|---|---|
| Startup time | AOT/CRaC |
| Network hops | Coarse APIs |
| Autoscaling lag | Pre-scaling |
9Architecture & Design Considerations
| Guideline | Detail |
|---|---|
| Design for failure | Everywhere |
| Declarative everything | Git |
| Right runtime per workload | Containers, serverless, managed |
10Interview Questions & Answers
What is cloud-native architecture?
Cloud-native architecture is an approach to designing and running systems that takes full advantage of the cloud: elastic capacity, automation and managed services, while assuming that components will fail. Applications are built as independently deployable services, packaged in containers or run on serverless platforms, managed declaratively, observed continuously and designed with resilience patterns such as retries, timeouts and circuit breakers. The result is frequent, safe deployment, fast recovery and costs that follow demand. It is an operating model, not just a hosting location. Teams usually adopt it gradually, service by service.
Name cloud-native pillars.
Common pillars of cloud-native systems are: microservices or other independently deployable units with clear boundaries; containers as a standard packaging format; orchestration, usually Kubernetes, to schedule and heal workloads; DevOps practices with continuous delivery to deploy frequently and safely; observability through metrics, logs and traces; and resilience built into the design, such as redundancy and graceful degradation. Declarative infrastructure as code and immutable deployments support all of them. Together, these pillars let teams deliver small changes often while keeping the overall system reliable and recoverable.
How does cloud-native differ from lift-and-shift?
Lift-and-shift moves applications to cloud infrastructure largely unchanged, often to virtual machines with the same sizing and operating practices. It changes where systems run but not how they are built or operated, so many cloud benefits, such as elasticity and automated recovery, remain unused. Cloud-native changes the operating model: applications are stateless, deployed automatically, scaled dynamically, observed and designed for failure. Lift-and-shift can be a useful first step, but on its own it rarely delivers the expected savings or agility. Many organisations rehost first for speed, then refactor their most valuable systems once they are running in the cloud.
What are the 6 Rs?
The 6 Rs are options for migrating applications to the cloud. Rehost means moving as-is, often called lift-and-shift. Replatform means making small changes to use managed services, such as moving a database to RDS. Refactor means re-architecting to be cloud-native. Repurchase means replacing the application with a SaaS product. Retain means keeping it where it is for now. Retire means switching it off. Choosing per application based on business value and effort produces a realistic migration plan. Most portfolios use a mix of all six, revisited as the migration progresses.
What is a distributed monolith?
A distributed monolith is a system split into microservices that are still so tightly coupled that they must be changed, tested and deployed together. Typical causes are shared databases, shared domain libraries, synchronous call chains and breaking API changes. It combines the coordination costs of a monolith with the network latency and partial failures of a distributed system, so it gets the downsides of both. The remedy is clearer boundaries, owned data and compatible contracts, or merging services that cannot be separated. Watch for services that are always released together as an early warning sign.
How do you make Java services cloud-friendly?
Make the JVM aware of its container and quick to start and stop. Set memory with -XX:MaxRAMPercentage so the heap fits the container limit. Reduce start-up time with class-data sharing, AOT caches, CRaC or native images, so autoscaling helps quickly. Implement graceful shutdown so in-flight requests finish when pods stop. Expose liveness and readiness probes that reflect the service's real health. Externalise configuration and state, emit metrics and traces, and keep images small and secure. Measure start-up time and memory use regularly, because both drift as applications grow.
Why declarative management?
With declarative management, you describe the desired state, such as the number of replicas or the configuration of a load balancer, and controllers continuously compare it with the actual state and make changes to converge. If something drifts, for example a pod crashes or a manual change is made, the controller restores the desired state automatically. Desired state stored in Git is reviewable, versioned and reproducible. This is more reliable than imperative scripts, which run once and cannot correct later drift. It also makes environments easy to recreate after a failure.
When is cloud-native not appropriate?
Cloud-native is not always worth its complexity. Small, simple applications with few users may run more cheaply and simply on a PaaS or a single virtual machine. Stable back-office systems that rarely change may not benefit from refactoring. Some regulated or latency-critical systems may be better retained on-premises for now. Teams without automation and operational maturity may struggle. In these cases, simpler options or a gradual approach deliver better value than a full cloud-native redesign. The decision should be made per system, based on value and team readiness.
How do you measure cloud-native success?
Measure outcomes that cloud-native is supposed to improve. Deployment frequency and lead time show delivery speed. Mean time to restore shows resilience. The share of infrastructure provisioned through self-service shows platform maturity. Unit cost, such as cost per order, shows efficiency as volume grows. Track these per service and over time, and compare with the baseline before transformation. Outcome metrics are more meaningful than counts of migrated services or containers. Pair these figures with user-facing measures, such as availability and latency, so improvements reflect real customer experience rather than internal activity alone.
What organisational changes are needed?
Organisations need to change alongside the technology. Stream-aligned teams should own services end to end, including running them in production. A platform team should provide self-service tools, golden paths and paved roads that reduce cognitive load. Enabling teams, such as SRE, should help with reliability and new practices. Guardrails, such as security and cost policies, should be implemented as code rather than manual approvals. Leadership must fund platform work and support a culture of learning from failure. Without these changes, new technology tends to recreate old bottlenecks.
Test your knowledge on this topic →Flashcards from this topic's 10 questions, filtered by level and type.