Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Your company is moving 150 Java services from Elastic Beanstalk and hand-built EC2 instances to containers. Teams are split between ECS on Fargate and EKS. How do you make the platform decision, and what do you standardize for Java workloads regardless of the choice?

I would decide with explicit criteria, team skills, need for Kubernetes ecosystem tools, multi-cloud or on-premises plans, how many platform engineers we can staff and cost at our scale, and pick one default with a documented exception path: ECS on Fargate if we mainly want low operations on AWS, EKS if we need portability and the ecosystem and can fund a platform team. Whatever we choose, we standardize the Java side, supported JDK base images, container-aware JVM flags, Actuator health and metrics, structured logs and OpenTelemetry, and the delivery side, image builds, infrastructure as code, deployment strategy and secrets, then migrate in waves starting with stateless services while tracking cost and incidents.

Why this question is asked

Moving 150 services off Beanstalk and hand-built EC2 is a chance to fix years of inconsistency, and a risk of creating two new platforms if half the teams pick ECS and half pick EKS. Interviewers ask this at the principal level because the answer is not "ECS is better" or "Kubernetes is the standard" but a decision process the organization can accept, plus a set of standards that matter more than the orchestrator. In this answer, we will define the decision criteria, compare the two platforms against them, standardize what Java workloads need on either, standardize delivery, and plan the migration waves.

1Deciding With Criteria, Not Preferences

Teams are split because each side has a good argument. ECS teams value simplicity; EKS teams value the ecosystem and portability. Instead of a vote, we write down the criteria that matter for this company and score both options against them. The main criteria are team skills today, the need for Kubernetes ecosystem tools such as operators, Helm charts or a service mesh, plans to run on other clouds or on-premises, how many engineers we can dedicate to running the platform, and the cost at our scale, including people.

The outcome should be one default platform plus a documented exception path, for example: services use the default unless a written proposal shows a need the default cannot meet. Two equal platforms double the templates, the on-call knowledge and the security reviews.

Scoring the two options
CriterionECS on FargateEKS
Operations effortlow: no cluster or nodeshigh: upgrades, add-ons, nodes
EcosystemAWS integrationslarge Kubernetes ecosystem
PortabilityAWS onlyany Kubernetes
Platform team neededsmalldedicated, several engineers
Learning curve for app teamsshortlonger
Fits current skills?depends on teamsdepends on teams
The weights come from the company's plans, not from the tools.

2What Each Platform Really Costs

ECS on Fargate minimizes operations: AWS runs the scheduler and the capacity, and our work is task definitions, services and load balancers. The trade-offs are lock-in to AWS, a smaller set of ecosystem tools, and a higher price per vCPU than well-packed EC2 nodes, although ECS can also run on EC2 capacity when that matters.

EKS gives a portable API and a huge ecosystem, but the cluster is ours to operate. Kubernetes versions have a limited support window, so every cluster needs upgrades several times a year, along with add-ons for networking, DNS, ingress, autoscaling, secrets and observability, each with its own versions. That needs a platform team, realistically three or more engineers for a company this size, and their cost belongs in the comparison. If the company has no multi-cloud plans and no Kubernetes skills, ECS is usually the better default; if it already runs Kubernetes elsewhere or depends on its tooling, EKS is.

3Standardizing the Java Side Regardless of Platform

Most of the value of this migration comes from standards that do not depend on the orchestrator. We publish base images with a supported JDK such as Amazon Corretto or Eclipse Temurin, patched on a schedule, running as a non-root user. We set container-aware JVM flags by default. Every service exposes Actuator health, liveness and readiness, and Prometheus or OTLP metrics, logs as structured JSON to standard output, and is instrumented with OpenTelemetry so traces cross service boundaries. A shared Spring Boot starter carries the defaults so teams inherit them.

Java
FROM eclipse-temurin:25-jre # or an Amazon Corretto image; patched base, rebuilt weekly
RUN useradd --system app
USER app
COPY target/app.jar /app/app.jar
ENV JAVA_TOOL_OPTIONS="-XX:MaxRAMPercentage=75 -XX:+ExitOnOutOfMemoryError"
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app/app.jar"] # exec form: the JVM gets SIGTERM directly
Step throughThe Java workload standard
  1. Base imagesupported JDK, non-root, patched weekly
  2. JVM defaultsMaxRAMPercentage, exit on OOM
  3. Spring Boot starterActuator probes, metrics, JSON logs, OpenTelemetry
  4. Deliverybuildpacks or shared Dockerfile, IaC module, rolling or blue/green
  5. PlatformECS on Fargate or EKS, behind the same contract

5 layers, from the top down. Step through them one at a time.

Everything above the platform layer is the same for every service.

Notice the exec form of ENTRYPOINT. With the shell form, a shell becomes process 1 and may not pass SIGTERM to the JVM, so graceful shutdown never runs and the container is killed after the timeout. ExitOnOutOfMemoryError makes a JVM that runs out of heap exit so the orchestrator restarts it, instead of limping along.

4Standardizing Delivery

Delivery is the other half. Images are built the same way everywhere, either with Cloud Native Buildpacks through Spring Boot's build-image goal or with one shared Dockerfile, and scanned before they are pushed. Infrastructure is described as code with a shared module per service type, so a new service is a few lines of configuration. Deployments use one or two approved strategies, rolling with health checks for most services and blue/green for critical ones, with automatic rollback on failing health checks or alarms. Secrets come from Secrets Manager or Parameter Store through the platform's native mechanism, never baked into images or environment files.

5Migrating in Waves

We migrate in waves. The first wave is a handful of stateless HTTP services owned by willing teams, which proves the templates and finds the gaps. Later waves bring the bulk of stateless services, using the templates with little platform help. Services with local state, sticky sessions, special networking or scheduled jobs on specific instances come last, often needing changes first.

Before and after each wave, we track cost per service, deployment frequency, time to recover and incident rate. Those numbers keep the program honest: if incidents go up, we slow down and fix the templates; if cost per service drops, it supports the funding for the next wave. A target of 150 services over 12 to 18 months, with the Beanstalk environments switched off as each wave lands, is realistic.

6Follow-up questions

How would you handle services that need sticky sessions?

First we ask why they need them. Usually it is HTTP session state kept in memory, which breaks whenever a task is replaced. The best fix is to move session state out of the JVM with Spring Session backed by Redis, for example on ElastiCache, or to use stateless tokens, after which any task can serve any request. Where that cannot happen yet, both ALB target groups and Kubernetes ingress controllers support cookie-based stickiness, so the service can migrate with stickiness on as a documented exception, accepting that users lose sessions on deployments until the state is moved.

Would you ever allow both ECS and EKS?

Yes, as a deliberate exception, for example a data platform team that depends on Kubernetes operators while everything else runs on ECS. The Java and delivery standards still apply, so services look the same to the rest of the company. What we avoid is two defaults with no criteria.

What would make you change the decision later?

A change in the criteria: a multi-cloud requirement, an acquisition that brings large Kubernetes estates, or growth that makes a dedicated platform team affordable and the ecosystem valuable. Because the Java and delivery standards are platform-independent, switching later costs much less.

7Conclusion

In this answer, we made the ECS versus EKS decision with explicit criteria, skills, ecosystem needs, portability plans, platform staffing and cost, and chose one default with an exception path. We standardized what matters on either platform: supported JDK base images, container-aware JVM flags, Actuator probes, structured logs and OpenTelemetry, plus image builds, infrastructure as code, deployment strategies and secrets. Then we migrated in waves, stateless services first, tracking cost and incidents.

What to say in the interviewAbout 100 seconds aloud

Open with

I would not let this become a vote between two camps. I would write down the criteria that matter for us: the skills teams have today, whether we need Kubernetes ecosystem tools like operators or a service mesh, whether we really plan to run on other clouds or on-premises, how many engineers we can put on a platform team, and the full cost at our scale, including people.

Then, if they want more

Then we pick one default and an exception path. ECS on Fargate minimizes operations: no cluster upgrades, no nodes, tight AWS integration. EKS gives portability and a huge ecosystem, but needs a dedicated platform team for version upgrades and add-ons. Without multi-cloud plans or existing Kubernetes skills I would lean to ECS; with them, EKS.

More important than the orchestrator is what I standardize for every Java service either way. Base images with a supported JDK like Corretto or Temurin, running as non-root and patched regularly. Container-aware JVM flags such as MaxRAMPercentage, and exec-form entrypoints so SIGTERM reaches the JVM.

Actuator liveness and readiness probes and metrics, structured JSON logs and OpenTelemetry tracing, delivered through a shared Spring Boot starter. On the delivery side, one image build approach, buildpacks or a shared Dockerfile, infrastructure-as-code modules, rolling or blue-green deployments with automatic rollback, and secrets from Secrets Manager or Parameter Store.

Then I would migrate in waves, starting with stateless services owned by willing teams, and track cost per service and incident rates before and after each wave.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
AWS documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your company is moving 150 Java services from Elastic Beanstalk and hand-built EC2...": https://scrivio-interview-library.netlify.app/spring-boot/aws/92cb12b664/