Quick revision
The short answer
I would make the local environment part of each service's repository: a committed compose.yaml started automatically by Spring Boot's Docker Compose support, or Testcontainers wired in at development time, so one command starts the service and its dependencies. A platform team provides shared images with seed data for common dependencies, pinned to the same versions as production. We document a one-command start, measure time to first run for new joiners, and offer remote development environments for services whose dependencies do not fit on a laptop.
What to remember
In this answer, we designed a standard local environment for 40 teams. Each service commits its dependencies in a compose.yaml started by Spring Boot's Docker Compose support, or uses Testcontainers at development time. A platform team publishes seeded, versioned images that match production versions, every service documents the same one-command start, and time to first run is measured for new joiners. Remote development environments cover the few services whose dependencies do not fit on a laptop.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would make the local environment part of each service's repository: a committed compose.yaml started automatically by Spring Boot's Docker Compose support, or Testcontainers wired in at development time, so one command starts the service and its dependencies. A platform team provides shared images with seed data for common dependencies, pinned to the same versions as production. We document a one-command start, measure time to first run for new joiners, and offer remote development environments for services whose dependencies do not fit on a laptop.
Why this question is asked
When every team sets up databases, brokers and caches by hand, each developer loses hours on their first day and more every time a version changes. Across 40 teams this becomes hundreds of engineer-days a year, and the setups drift so far apart that bugs appear only on some machines. Interviewers ask this design question to see whether we can turn a messy, per-team habit into a shared standard that teams actually adopt. In this answer, we will look at the per-service setup, the shared images, version alignment with production, the one-command start and how we measure it, and finally remote environments for the cases a laptop cannot handle.
1The Per-Service Setup: Committed and Automatic
The foundation is that a service's local environment lives in the service's own repository, versioned with its code. Each service commits a compose.yaml describing the dependencies it needs. With Spring Boot's Docker Compose support on the classpath, starting the application from the IDE starts those containers, waits until they are ready and creates service connections, so no connection properties need to be written by hand.
For teams that prefer to keep everything in Java, Testcontainers at development time is an equally good option: a TestApplication class in src/test starts the application with container beans marked @ServiceConnection, and the same configuration is used by the integration tests. The standard can allow either, as long as one command starts everything.
2Shared Images With Seed Data
Starting an empty database is not enough; developers need data to click through the application. Today each team keeps its own SQL scripts, and they break as the schema changes. A platform team can instead publish images for common dependencies, built in CI, that already contain the schema and a small, realistic, anonymised data set. For example, a postgres-orders image with 500 customers and 2,000 orders, rebuilt whenever the migrations change.
The images live in an internal registry with clear tags, so a service pins the exact version it expects. Never use production data in them: seed data is generated or anonymised, which also keeps the images safe to distribute to every laptop.
3Keep Versions Close to Production
Local dependencies should run the same major and minor versions as production: PostgreSQL 17 locally if production runs 17, the same Kafka version, the same Redis. A difference here is how bugs slip through: a SQL feature that works on a newer local database fails in production, or a behaviour change in a broker shows up only after deployment.
The platform team can enforce this cheaply. The image tags in the shared registry follow production versions, and a CI check compares each service's compose.yaml against a list of approved versions and warns when one drifts.
- Service repository
compose.yamlorTestApplication, one-command start - Spring Boot supportDocker Compose support or Testcontainers service connections
- Shared platform imagesseeded, versioned, built in CI
- Internal registrypinned tags matching production versions
- Container runtime on the laptopor a remote dev environment
5 layers, from the top down. Step through them one at a time.
Teams own the top layer; the platform team owns the layers below.
4One Command, Documented and Measured
The promise to a new joiner is simple: clone the repository, install the standard toolkit, run one command. The README of every service says the same thing in the same place, generated from a template so it stays uniform. Prerequisites are few and documented once at company level: a JDK, a container runtime and access to the registry.
Then we measure. Time to first run, from a fresh laptop to a running service that responds to a request, is the key number. We collect it during onboarding, either with a short script that records timestamps or simply by asking new joiners, and we track it per service. If the company average falls from two days to under two hours, the investment is visible; if one service takes five hours, we know where to help.
- Laptop with standard toolkitJDK, container runtime, registry login
- git clone the service
- ./mvnw spring-boot:runBoot starts the containers
- Service answers on /actuator/health?YesRecord time to first runNoRecord the blocker and fix the template
4 steps in order. Play them, or step through them one at a time.
Every blocker found here is a fix for the next 39 teams too.
5Remote Environments for What Does Not Fit
Some services cannot run on a laptop: they need many dependencies, large data sets or more memory than the standard machine has. For them, a remote development environment, a container or virtual machine in the cloud that runs the same compose setup and that the developer's IDE connects to, gives the same one-command experience without local resources. Cloud development environments also help with onboarding, because the environment is ready before the developer starts.
They cost money while they run and depend on the network, so they should be the exception for heavy services rather than the default for everyone, with automatic shutdown after idle hours to control cost.
6Follow-up questions
How do you get 40 teams to adopt the standard?
Make the standard the easiest option rather than a rule. The platform team migrates two or three pilot services itself, publishes the before and after times, and provides a template and a short migration guide. New services get the setup from the service template automatically. Teams that adopt it lose nothing and gain hours, which spreads the standard faster than any mandate.
Docker Compose support or Testcontainers: which should the standard pick?
Either works, and many teams use both: Compose for a long-lived local environment shared with other tools, Testcontainers for tests and for teams that want the dev setup to reuse test configuration. The standard should fix the outcome, one command and pinned versions, rather than force one tool.
What about services that depend on other services, not only infrastructure?
For local work, we stub other services with contract-based mocks such as WireMock or Spring Cloud Contract stubs, packaged as images like any other dependency. Running the full graph of services locally does not scale; integration with real neighbours belongs in a shared environment.
7Conclusion
In this answer, we designed a standard local environment for 40 teams. Each service commits its dependencies in a compose.yaml started by Spring Boot's Docker Compose support, or uses Testcontainers at development time. A platform team publishes seeded, versioned images that match production versions, every service documents the same one-command start, and time to first run is measured for new joiners. Remote development environments cover the few services whose dependencies do not fit on a laptop.
Open with
I would make the local environment part of each service's code, so it is versioned and the same for everyone. Every repository commits a compose.yaml with its dependencies, and Spring Boot's Docker Compose support starts them when the app starts and creates service connections, so nobody writes connection properties.
Then, if they want more
Teams that prefer it can use Testcontainers at dev time with a TestApplication class; the rule is one command, not one tool. A platform team publishes shared images for the common dependencies, Postgres, Kafka, Redis, built in CI with the schema and a small anonymised seed data set, in an internal registry with pinned tags.
Those versions follow production, and a CI check flags services that drift, because version differences are where local-only and production-only bugs come from.
Every README has the same three steps, generated from the service template, and we measure time to first run for new joiners, aiming for well under two hours, and track it per service so we know where to help.
For the few services that cannot run on a laptop, we offer remote dev environments with the same setup and auto-shutdown to control cost. I would pilot it with two or three services, publish the time saved, and let the template carry it to new services.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- PostgreSQL 17
- 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
- Spring Boot reference
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 "Developers spend hours setting up local databases, brokers and caches for each service....": https://scrivio-interview-library.netlify.app/spring-boot/developer-experience/eebee22554/