ArchitectMind
  1. Home
  2. Java Ecosystem
  3. Book 9 · Cloud, Containers, DevOps & Production Architecture
  4. Volume VII
  5. Cloud-Native Principles
Book 9 · Volume VII — Cloud-Native Architecture & Multi-Region Systems · Topic 1.1

Cloud-Native Principles

Designing systems that exploit elasticity, automation and failure as a normal event

21 min readStage 4 · Production & architecture10 interview questions
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. 1. Concept / Definition
  2. 2. Why It Exists
  3. 3. Core Concepts — Cloud-Native Principles
  4. 4. How It Works Internally — The Cloud-Native Runtime Loop
  5. 4A. Deep Dive — Migration Strategies (the 6 Rs)
  6. 4B. Deep Dive — Anti-Patterns
  7. 4C. Deep Dive — Java in Cloud-Native Runtimes
  8. 4D. Deep Dive — Organisation and Operating Model
  9. 4E. Deep Dive — When Not to Go (Fully) Cloud-Native
  10. 5. APIs / Features / Syntax
  11. 6. Practical Examples
  12. 7. Common Problems & Mistakes
  13. 8. Performance & Production Considerations
  14. 9. Architecture & Design Considerations
  15. 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.

Cloud-native pillars
Figure 1 — Cloud-native pillars
Lift-and-shift vs cloud-native
Figure 2 — Lift-and-shift vs cloud-native
VocabularyMeaning
ElasticityScaling out and in automatically with demand
Declarative managementDescribe desired state; controllers converge to it
Cattle vs petsReplaceable instances vs hand-maintained servers
Distributed monolithMicroservices so coupled they must deploy together
Table 1 — Terms

2Why It Exists

Traditional constraintCloud-native response
Hardware bought for peak, idle most of the yearElastic scaling, pay per use
Weeks to provision environmentsAPI-driven infrastructure in minutes
Big releases, rare deploysIndependent services, continuous delivery
Failures handled manuallySelf-healing orchestration
Scaling limited by one big database/serverHorizontal scale, partitioning, managed services
Table 2 — Why
ShopNow cloud-native maturity journey
Figure 3 — ShopNow cloud-native maturity journey

3Core Concepts — Cloud-Native Principles

PrincipleMeaningShopNow practice
Design for failureAny component can fail at any timeTimeouts, retries with budgets, circuit breakers, multi-AZ
ElasticityScale with demandHPA/KEDA, Karpenter, Aurora Serverless for spiky workloads
StatelessnessState lives in backing servicesJWT sessions, Redis/DynamoDB, no local disk state
Loose couplingServices evolve independentlyEvents, versioned APIs, consumer-driven contracts
API-firstContracts before codeOpenAPI/AsyncAPI in repos
DeclarativeDesired state in GitGitOps, Terraform, ACK
AutomationNo manual repetitive workPipelines, runbook automation
ObservabilityTelemetry by defaultOTel in golden path
Security by defaultLeast privilege, zero trustIRSA, mTLS, policies
Cost awarenessCost is an architecture metricUnit cost per order, FinOps dashboards
Table 3 — Principles

4How It Works Internally — The Cloud-Native Runtime Loop

LayerMechanism
Desired stateGit (manifests, Terraform)
ControllersKubernetes, Argo CD, Karpenter, ACK reconcile continuously
HealthProbes, SLOs, autoscalers react to metrics
ReplacementFailed pods/nodes replaced automatically
ChangeNew immutable versions rolled out progressively
FeedbackTelemetry drives scaling, rollback and learning
Table 4 — How cloud-native systems stay healthy without humans

4ADeep Dive — Migration Strategies (the 6 Rs)

StrategyDescriptionWhen
Rehost (lift-and-shift)Move VMs as-isDeadline-driven data-centre exit
Replatform (lift-tinker-shift)Swap components (RDS for self-managed DB)Quick wins
Refactor / re-architectRedesign as cloud-native servicesCore differentiating systems
RepurchaseReplace with SaaSCommodity capabilities (HR, CRM)
RetainKeep on-prem for nowRegulated/core banking (NovaBank)
RetireSwitch offUnused applications
Table 5 — Not everything should be refactored

4BDeep Dive — Anti-Patterns

Anti-patternSymptomFix
Distributed monolithLock-step deploys, shared DBBounded contexts, owned data
Chatty services20 synchronous calls per requestCoarser APIs, aggregation, events
Lift-and-shift then "done"Same costs, same outagesReplatform/refactor roadmap
Kubernetes for everythingOps burden for simple workloadsServerless/managed where fitting
Snowflake environmentsDrift, "works in staging"Immutable, IaC
Ignoring costCloud bill surprisesFinOps, unit economics
Table 6 — Common failures

4CDeep Dive — Java in Cloud-Native Runtimes

ConcernJava 25 / Spring Boot 4 approach
Startup time for scalingCDS/AOT cache, Spring AOT; CRaC for checkpoint/restore; GraalVM native image for functions/CLI
Memory footprintContainer-aware JVM (-XX:MaxRAMPercentage), right-sized heaps
ConcurrencyVirtual threads for blocking I/O at scale
Graceful shutdownserver.shutdown=graceful + preStop hook
ConfigurationSpring profiles + env/ConfigMaps, no rebuilds per env
HealthActuator liveness/readiness groups
Table 7 — Making the JVM a good cloud citizen

4DDeep Dive — Organisation and Operating Model

ElementCloud-native practice
Team structureStream-aligned teams owning services end to end
PlatformPlatform team provides golden paths (Volume IV)
OwnershipYou build it, you run it
GovernanceGuardrails as code, not approval boards
SkillsEngineers comfortable with IaC, Kubernetes, observability
Table 8 — Conway's law applies

4EDeep Dive — When Not to Go (Fully) Cloud-Native

SituationBetter choice
Small team, simple appModular monolith on a PaaS/serverless
Stable, rarely changed back officeRehost or retain
Hard real-time/latency on specialised hardwareSpecialised infrastructure
Regulatory constraints on data location/controlHybrid (NovaBank core banking)
Very steady load at huge scaleReserved capacity; cost modelling
Table 9 — Principles still apply; the degree varies

5APIs / Features / Syntax

YAML
# 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 } } }
YAML
# 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
BASH
# 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.jar

6Practical 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.

DimensionLevel (1–5)
Delivery automation4
Elasticity4
Resilience3
Observability4
Cost management2
Table 10 — Find the weakest dimension

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.

StateLocation
User sessionJWT + Redis
UploadsS3 (presigned)
Scheduled jobsLeader election / Kubernetes CronJobs
Table 11 — Nothing on local disk

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.

MetricValue
Infra cost per order₹3.20 (target ₹3.00)
Table 12 — Unit economics

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?"

PromptAnswer 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."
Table 13 — Structured answer

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.

PrincipleApplication
Design for failure + blast radiusIndependent cells, automated cell provisioning
Table 14 — Cloud-native at scale

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-patternEffect
Pets in Kubernetes (manual kubectl edits)Drift
Autoscaling without capacity planningDownstream overload
Ignoring JVM container limitsOOM kills
Table 15 — Common mistakes

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.

TimeCheckout pods
03:0012
20:00 sale74
Table 16 — Pay for what you use

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.

FailureAutomatic response
Pod crashRestart
Node failureReschedule, Karpenter replaces node
AZ impairmentZonal shift
Table 17 — Humans for novel problems only

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.

ArtifactUse
OpenAPI spec reviewed before implementationParallel frontend/backend work
Table 18 — Contracts enable independence

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.

ImperativeDeclarative
"kubectl scale --replicas=10"replicas in Git, HPA bounds
Table 19 — Desired state wins

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.

MetricBeforeAfter
Startup to ready14 s0.8 s
Table 20 — Faster reaction to spikes

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.

WorkloadChoice
Image thumbnailingLambda
CheckoutEKS
Table 21 — Right runtime per workload

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-upAnswer
"Is Kubernetes required?"No — containers, serverless or PaaS can all be cloud-native
"Biggest risk?"Distributed complexity without automation and observability
Table 22 — Common probes

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✔
Table 23 — Cloud-native baseline

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.

TeamRole
Stream-aligned (checkout)Own service lifecycle
PlatformGolden paths
Enabling (SRE)Reliability practices
Table 24 — Organisation supports architecture

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.

PracticeFrequency
Pod/AZ chaos in stagingWeekly/monthly
Table 25 — Prove design for failure

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.

ChoicePortability
Kubernetes APIs, OTel, OCI imagesHigh
DynamoDB, Step FunctionsLower (accepted for value)
Table 26 — Conscious lock-in

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?"

QuestionAnswer
"Leadership wants to 'go cloud-native' in 6 months"Assess portfolio, 6Rs per app, platform first, incremental refactoring
Table 27 — Realistic roadmap

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.

MetricTarget
Deployment frequencyDaily per service
MTTR< 30 min
Infra provisioningSelf-service
Table 28 — Measure the outcome

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.

StepDetail
preStop sleep 10 sLB deregistration
Stop accepting, finish in-flight (25 s)No dropped requests
Table 29 — Disposability in practice

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.

EnvironmentMechanism
dev/staging/prodSame image, Kustomize overlays + Secrets
Table 30 — Build once, run anywhere

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.

PatternDetail
Kubernetes Jobs / AWS Batch with SpotElastic, cheap batch
Table 31 — Not just request/response

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

MistakeFix
Lift-and-shift onlyRefactor roadmap
Distributed monolithBounded contexts
No automationIaC, GitOps
Cost blindnessFinOps
Table 32 — Mistakes and fixes

8Performance & Production Considerations

ConsiderationPractice
Startup timeAOT/CRaC
Network hopsCoarse APIs
Autoscaling lagPre-scaling
Table 33 — Operating cloud-native systems

9Architecture & Design Considerations

GuidelineDetail
Design for failureEverywhere
Declarative everythingGit
Right runtime per workloadContainers, serverless, managed
Table 34 — Design guidance

10Interview Questions & Answers

Q1L1 · BasicConcept

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.

Q2L1 · BasicConcept

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.

Q3L2 · IntermediateTrade-off

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.

Q4L2 · IntermediateConcept

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.

Q5L3 · Senior EngineerTricky

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.

Q6L3 · Senior EngineerDesign

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.

Q7L4 · Technical ArchitectConcept

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.

Q8L4 · Technical ArchitectTrade-off

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.

Q9L5 · Solution ArchitectDesign

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.

Q10L5 · Solution ArchitectBehavioural

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.

Free question pack

Get 100 free Core Java interview questions

Subscribe for the Book 1 question pack (PDF, every answer explained) and new tutorials once a week. No spam, unsubscribe anytime. What is in the pack?

Almost done! Check your inbox and click the confirmation link. Your download link arrives as soon as you confirm.