Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

Choose a startup strategy for a company with about 1,000 Spring Boot services: the JDK AOT cache, GraalVM native image, or CRaC. How do you frame the decision as a multi-year bet?

For about 1,000 Spring Boot services, I would make the JDK AOT cache the default, because it keeps full JVM behaviour, needs only a training run and improves with each JDK release, and approve GraalVM native image as an exception for scale-to-zero, serverless and very small services where startup and memory dominate. CRaC stays an experiment, because it is outside OpenJDK mainline, depends on vendor builds and Linux checkpointing, and stores memory, including secrets, in the snapshot. The bet is revisited every year as Project Leyden ships more.

Background to this question

A startup strategy for a thousand services is not a performance tweak; it is a commitment that shapes build pipelines, base images, testing, vendor contracts and the skills of every team for years. Picking the fastest option on a benchmark is easy. Picking the option the organisation can live with in 2030 is harder, and that is what this question tests. In this answer, we will recap what each option actually does, compare them on the properties that last, match options to the needs of different services, describe a portfolio with a default and exceptions, and frame the whole thing as a bet with checkpoints to revisit it.

1What Each Option Actually Does

The JDK AOT cache, from JEP 483 in JDK 24 and extended in JDK 25, records which classes an application loads and links during a training run and stores them in that state, together with method profiles on JDK 25. The service still runs on the normal JVM; it just skips repeated startup work. Startup typically improves by tens of percent, not by orders of magnitude.

GraalVM native image compiles the application ahead of time into a standalone executable. It analyses the program at build time under a closed-world assumption, meaning everything that can run must be visible to the build, and anything dynamic such as reflection must be declared. In return a service can start in well under a second and use a fraction of the memory.

CRaC, Coordinated Restore at Checkpoint, takes a different route: it starts and warms up a normal JVM, writes a snapshot of the whole process to disk, and restores new instances from that snapshot in tens of milliseconds, already warm. It is an OpenJDK project, but it is not in the mainline JDK; it ships in some vendor builds, such as Azul's and BellSoft's, and relies on Linux checkpoint and restore support.

2Comparing the Options on What Lasts

Raw startup numbers favour native image and CRaC. But over several years, the costs that matter are compatibility (does every library just work), the effort per service (what each team must do and keep doing), the dependency on outside parties, and how the option improves over time without our effort.

Startup options for a large fleet
PropertyAOT cacheNative imageCRaC
Startup gainModerate, tens of percentLargest, often under 1 sVery large, warm on restore
CompatibilityFull JVM behaviourClosed world, metadata neededFull JVM, but state must be refreshed
Work per serviceA training run in the buildHints, native tests, long buildsResource callbacks, restore tests
Peak throughputNormal JITLower without PGONormal JIT, already warm
Outside dependencyNone, mainline OpenJDKGraalVM distributionVendor JDK and Linux CRIU
Security concernNone specialNone specialSnapshot holds memory and secrets
Improves over timeWith each JDK releaseWith each GraalVM releaseUncertain, not in mainline
The default should win on the rows that cost money every year, not only on startup.

Notice the last row in particular. The AOT cache gets better every six months simply by moving to a newer JDK, because Project Leyden keeps adding things to the cache. Native image also improves, but each service carries metadata and native tests that we maintain ourselves. CRaC's future depends on whether it ever reaches mainline, which nobody can promise.

3Matching the Option to the Need

The right question is not which option is best but which need each service has. A service that scales to zero, such as a function behind an HTTP trigger, pays its full startup cost on many requests, so a 3-second JVM start against a 100-millisecond native start is the difference between a usable product and an unusable one. A long-running order service with 20 instances that restart once a week pays startup rarely, and cares much more about peak throughput, debugging and library compatibility.

In a typical fleet, the large majority of services are of the second kind. If 900 of our 1,000 services are long-running, a default that costs each of them a week of native image work would spend 900 team-weeks to save seconds that nobody notices. The same effort spent on the 50 services that scale to zero might be well worth it.

Step throughChoosing a startup option for one service
  1. Does it scale to zero or run as a function?
    YesNative image candidateNoContinue
  2. Is memory per instance the main cost?
    YesNative image candidateNoContinue
  3. Is startup slowing scale-out or rollouts?
    YesDefault: AOT cacheNoDefault: AOT cache, low priority
  4. Native candidate passes metadata and native test checks?
    YesApproved exceptionNoStay on AOT cache

4 steps in order. Play them, or step through them one at a time.

CRaC enters only through a separate, time-boxed experiment.

4A Portfolio: One Default and Approved Exceptions

With a thousand services, a single answer for all is wrong, and a free choice for each team is also wrong, because every option needs platform support: base images, pipeline steps, observability and on-call knowledge. So we define a portfolio. The AOT cache is the default, wired into the shared build template, so every service gets it without effort. Native image is an approved exception with clear entry criteria, such as scale-to-zero, a strict memory budget, or a startup target the cache cannot meet, and with obligations: native tests in CI, a supported list of libraries, and an owner who maintains the metadata.

CRaC is not forbidden, but it enters as a time-boxed experiment on one or two services, run with the security team, because a snapshot contains everything that was in memory, including credentials. If it reaches OpenJDK mainline and our platform allows the privileges it needs, we can promote it; until then, the vendor dependency is too large a bet for a thousand services.

5Framing the Decision as a Multi-Year Bet

A good way to present this to other leaders is to state the bet and its exit conditions explicitly. The bet is that the JDK's own AOT work will keep closing the gap, so the cheapest default today is also the one most likely to improve without us paying for it. Project Leyden has already shipped class loading and linking, method profiling and better command-line ergonomics, and its stated direction includes caching more, such as compiled code, in later releases.

The exit conditions are the signals we revisit each year, with each JDK LTS or the next major Spring Boot release: whether native image builds have become fast and compatible enough to be the default for small services, whether CRaC has reached mainline, and whether our measured startup and memory costs have changed. Each review looks at real numbers from the fleet, such as median time to ready, total memory and the cost of native exceptions, so the decision can change on evidence rather than on fashion.

6Follow-up questions

Why not choose native image for everything if it is the fastest?

Because the cost is paid per service and forever: reachability metadata, longer builds, native tests in CI, libraries that do not support it, and lower peak throughput without profile-guided optimisation. For long-running services that start once a week, the startup gain is worth very little compared with that cost.

Is CRaC unsafe?

It is not unsafe by itself, but it needs care. The snapshot contains the whole heap, so secrets, tokens and keys are written to disk and must be protected and refreshed after restore. Restore also needs Linux checkpoint support and extra privileges in many setups, and the feature depends on vendor JDK builds. Those are reasons to keep it as a controlled experiment, not reasons to dismiss it.

How would you measure whether the default is working?

Per service, track time to ready, time until latency settles and memory at steady state, before and after the cache. Across the fleet, track the share of services where the cache is accepted at startup, and the total compute hours spent on startup during scale-out. Those numbers tell us both that the default is in place and that it is paying off.

7Conclusion

In this answer, we compared the AOT cache, native image and CRaC on the things that last for years: compatibility, effort per service, outside dependencies and how each improves over time. The AOT cache keeps full JVM behaviour and improves with every JDK, so it is the default; native image is an approved exception for scale-to-zero and memory-bound services; CRaC stays an experiment because of vendor, platform and snapshot security concerns. The decision is a bet with stated review points, revisited with fleet data as Leyden ships more.

What to say in the interviewAbout 80 seconds aloud

Open with

I would frame it as a portfolio with one default. For a thousand services, most of them long-running, the JDK AOT cache is the default: it keeps full JVM behaviour and compatibility, it needs only a training run that we can add to the shared build template, and it gets better every JDK release without any work from the teams.

Then, if they want more

The gain is moderate, tens of percent, but it is nearly free.

GraalVM native image gives the fastest startup and smallest memory, but it needs closed-world metadata, longer builds, native testing, and peak throughput is lower without profile-guided optimisation, so I would approve it as an exception with clear criteria, like scale-to-zero, serverless or a strict memory budget, and with obligations such as native tests in CI.

CRaC restores a warmed JVM almost instantly, but it is not in OpenJDK mainline, it depends on vendor builds and Linux checkpointing, and the snapshot holds everything in memory, including secrets, so it would be a time-boxed experiment with the security team.

I would present this as a multi-year bet on the JDK's own Leyden work, with yearly reviews based on fleet numbers like time to ready and memory, and clear conditions under which we would change the default.

About this answer

Last updated
12 November 2026
Versions it names
Java 25, Java 24
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.
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 "Choose a startup strategy for a company with about 1,000 Spring Boot services: the JDK...": https://scrivio-interview-library.netlify.app/java/startup-and-footprint/ea6b0ffe6f/