ArchitectMind
  1. Home
  2. Java Ecosystem
  3. Book 4 · Spring & Spring Boot
  4. Volume I
  5. Spring Ecosystem
Book 4 · Volume I — Spring Core, IoC & Dependency Injection · Topic 1.4

Spring Ecosystem

The portfolio of Spring projects around the Framework — what each one solves, how they fit together, and how versions are aligned

11 min readStage 2 · Frameworks & design8 interview questions
Chapter
Chapter 1 — Spring Framework Fundamentals
Prerequisites
Topics 1.1–1.3
You will be able to
Map a business or technical need to the right Spring project, explain version alignment, and assess ecosystem lock-in
Covers
Spring Framework · Spring Boot · Spring Data · Spring Security · Spring Cloud · Spring Integration · Spring Batch · Spring Kafka
On this page
  1. 1. Concept / Definition
  2. 2. Why It Exists
  3. 3. Core Concepts
  4. 4. How It Works Internally
  5. 4A. Deep Dive — Support Lifecycles and Ecosystem Governance
  6. 5. APIs / Features / Syntax
  7. 6. Practical Examples
  8. 7. Common Problems & Mistakes
  9. 8. Performance & Production Considerations
  10. 9. Architecture & Design Considerations
  11. 10. Interview Questions & Answers

1Concept / Definition

The Spring ecosystem is the portfolio of open-source projects maintained under the Spring umbrella (spring.io) that build on the Spring Framework. The Framework supplies the container, AOP, web and data-access foundations; Spring Boot turns them into production-ready applications with minimal configuration; and a set of specialised projects — Data, Security, Cloud, Integration, Batch, Kafka and many more — solve specific enterprise problems using the same programming model.

The ecosystem as concentric layers around the Framework
Figure 1 — The ecosystem as concentric layers around the Framework

2Why It Exists

  • Enterprise systems need more than DI. Real systems need persistence, security, messaging, batch processing, distributed configuration and observability. Rather than each team integrating these ad hoc, Spring projects provide tested, idiomatic integrations.
  • Consistency across problem domains. A Kafka listener, a JPA repository and an OAuth2 resource server are all configured, overridden and tested in the same way.
  • Pace of change. Separate projects can follow their own technologies (a new Kafka client, a new OAuth spec) without waiting for a Framework release.
  • Curated compatibility. Spring Boot's dependency management and the Spring Cloud release train certify combinations of versions, removing the "dependency hell" of assembling a stack by hand.

3Core Concepts

3.1 Spring Framework

The foundation: IoC container, AOP, MVC and WebFlux, transactions, JDBC/ORM integration, messaging abstractions, testing. Current generation: 7.0 (November 2025) with a JDK 17 minimum, Jakarta EE 11 alignment, JSpecify null-safety, API versioning, core resilience annotations and BeanRegistrar. Every other project depends on it.

3.2 Spring Boot

An opinionated layer for building stand-alone, production-grade applications.

  • Auto-configuration — conditional configuration activated by classpath contents and properties (@ConditionalOnClass, @ConditionalOnMissingBean).
  • Starters — curated dependency sets.
  • Embedded servers — Tomcat (default) or Jetty inside an executable JAR.
  • Externalised configuration — application.yaml, profiles, environment variables, config trees.
  • Actuator — health, metrics (Micrometer), info, and management endpoints.
  • Current generation: 4.0, built on Framework 7, with modularised auto-configuration, Jackson 3 by default, and HTTP service client auto-configuration. Covered in Volume III.

3.3 Spring Data

A family of modules providing a consistent repository abstraction over many stores.

  • Common: Repository, CrudRepository, ListCrudRepository, PagingAndSortingRepository, derived queries (findByStatusAndCreatedAfter), projections, auditing, @Query.
  • Store modules: JPA, JDBC, R2DBC, MongoDB, Redis, Cassandra, Elasticsearch, Neo4j, Couchbase, and more. Covered in Volume V.

3.4 Spring Security

Authentication and authorization for Servlet and reactive applications: SecurityFilterChain, password encoding, session management, CSRF protection, method security (@PreAuthorize), OAuth2 client and resource server, OIDC login, SAML 2.0, and passkeys. Spring Authorization Server provides OAuth 2.1/OIDC provider capabilities. Covered in Volume VI.

3.5 Spring Cloud

Patterns for distributed systems, delivered as a release train of sub-projects:

Sub-projectPurpose
Spring Cloud ConfigCentralised, versioned configuration (Git, Vault, JDBC backends)
Spring Cloud GatewayAPI gateway on WebFlux or MVC: routing, filters, rate limiting
Spring Cloud Netflix (Eureka) / Consul / KubernetesService discovery
Spring Cloud Circuit BreakerAbstraction over Resilience4j
Spring Cloud OpenFeignDeclarative HTTP clients (maintenance mode; HTTP interface clients preferred)
Spring Cloud StreamBinder-based event-driven microservices over Kafka, RabbitMQ and others
Spring Cloud FunctionBusiness logic as functions deployable to serverless platforms
Table 1 — Key Spring Cloud sub-projects

Release trains are named by year (for example 2025.1, codename Oakwood) and each train is compatible with a specific Spring Boot line.

3.6 Spring Integration

An implementation of Enterprise Integration Patterns: message channels, filters, routers, splitters, aggregators, transformers, service activators, and inbound/outbound adapters for files, (S)FTP, HTTP, JDBC, JMS, AMQP, Kafka, MQTT, mail and more. Configured with a Java DSL (IntegrationFlow). Covered in Volume VII.

3.7 Spring Batch

A framework for robust, high-volume batch processing.

  • Model: Job → Step → chunk-oriented ItemReader → ItemProcessor → ItemWriter, or tasklet steps.
  • A JobRepository records execution metadata to support restart, skip and retry policies.
  • Scaling: multi-threaded steps, partitioning, remote chunking.

3.8 Spring for Apache Kafka

Idiomatic Kafka support: KafkaTemplate for producing, @KafkaListener with listener containers for consuming, transactions (exactly-once within Kafka), error handlers with dead-letter publishing, non-blocking retry topics, and Kafka Streams integration. Spring Cloud Stream can use it as a binder when a broker-neutral model is preferred.

ProjectPrimary problemKey abstractionVolume in this library
Spring FrameworkObject wiring, AOP, web, txApplicationContextBook 4 Vol I–II, IV
Spring BootSetup, defaults, operationsAuto-configurationBook 4 Vol III
Spring DataPersistence boilerplateRepository interfacesBook 4 Vol V
Spring SecurityIdentity and accessSecurityFilterChainBook 4 Vol VI
Spring CloudDistributed-system patternsConfig, gateway, discoveryBook 4 Vol VII, Book 7
Spring IntegrationIntegration patternsIntegrationFlowBook 4 Vol VII
Spring BatchBulk processingJob / Step / chunkBook 4 Vol VII
Spring for Apache KafkaKafka producing/consumingKafkaTemplate, @KafkaListenerBook 4 Vol VII, Book 6
Table 2 — Ecosystem summary with cross-references

4How It Works Internally

4.1 One integration pattern everywhere

Every ecosystem project integrates with the application in the same three steps, which is why they compose so easily:

1. Dependencies — a starter adds the project's JARs.

2. Auto-configuration — Boot registers infrastructure beans when conditions match (for example, KafkaAutoConfiguration creates a KafkaTemplate if spring-kafka is present and none is defined).

3. Extension by beans — you customise by declaring your own bean of the same type (auto-configuration backs off via @ConditionalOnMissingBean) or a *Customizer bean.

JAVA
// Overriding an auto-configured bean: Boot backs off because one already exists
@Configuration
class KafkaConfig {
    @Bean
    DefaultErrorHandler kafkaErrorHandler(KafkaTemplate<Object, Object> template) {
        var recoverer = new DeadLetterPublishingRecoverer(template);
        return new DefaultErrorHandler(recoverer, new FixedBackOff(1_000L, 3));
    }
}

4.2 Version alignment

MechanismScopeExample
Framework BOMAll Framework modulesspring-framework-bom:7.0.x
Boot dependency managementFramework + Data + Security + Kafka + Batch + third-party librariesspring-boot-dependencies:4.0.x
Spring Cloud BOMAll Spring Cloud sub-projects for one release trainspring-cloud-dependencies:2025.1.x
Table 3 — Three levels of version alignment

The practical rule: pick a Spring Boot version, then pick the Spring Cloud release train documented as compatible with it, and let both manage everything else.

4ADeep Dive — Support Lifecycles and Ecosystem Governance

Support model. Spring projects follow a published support policy: each minor line receives open-source support for a limited period (around 13 months for Boot minors), and commercial support extends that for enterprises. Architects must plan upgrade cadence against these windows: a service left on an out-of-support line stops receiving CVE fixes in open source.

Generational alignment (current).

GenerationFrameworkBootJava baselineJakarta EE
Legacy5.3.x2.7.x8 (up to 17+)Java EE 8 (javax.*)
Previous6.x3.x179–10 (jakarta.*)
Current7.0.x4.0.x17 minimum, 25 recommended11
Table 4 — Spring generations and their platform baselines

Maintenance-mode projects. Some projects are superseded rather than evolved: Spring Cloud Netflix Hystrix and Ribbon were removed long ago in favour of Resilience4j and Spring Cloud LoadBalancer; Spring Cloud OpenFeign is in maintenance, with the Framework's HTTP interface clients (@HttpExchange) recommended for new code. Choosing a project should include checking its status on spring.io.

Newer projects worth knowing.

  • Spring Modulith — structure and verify modular monoliths; application events between modules; generated documentation.
  • Spring AI — portable abstractions for chat models, embeddings, vector stores, tool calling and retrieval-augmented generation.
  • Spring gRPC, Spring Pulsar, Spring Shell, Spring Session, Spring REST Docs, Spring GraphQL, Spring Authorization Server.

5APIs / Features / Syntax

XML
<!-- Spring Boot parent manages Framework, Data, Security, Kafka, Batch versions -->
<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>4.0.0</version>
</parent>
 
<!-- Spring Cloud is aligned separately by its release-train BOM -->
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-dependencies</artifactId>
      <version>2025.1.0</version>
      <type>pom</type><scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>
NeedStarter / dependency
REST servicespring-boot-starter-webmvc
JPA persistencespring-boot-starter-data-jpa
Resource server (JWT)spring-boot-starter-oauth2-resource-server
Kafkaspring-kafka (auto-configured by Boot)
Batch jobsspring-boot-starter-batch
Integration flowsspring-boot-starter-integration
Config clientspring-cloud-starter-config
Gatewayspring-cloud-starter-gateway-server-webflux (or -webmvc)
Observabilityspring-boot-starter-actuator + Micrometer registry
Table 5 — Common starters by need
Problem-first mapping from needs to Spring projects
Figure 2 — Problem-first mapping from needs to Spring projects

6Practical Examples

6.1 An order service combining five projects

JAVA
@SpringBootApplication                                   // Boot
public class OrderApp { public static void main(String[] a) { SpringApplication.run(OrderApp.class, a); } }
 
interface OrderRepository extends ListCrudRepository<Order, Long> {       // Data
    List<Order> findByStatus(Status status);
}
 
@Configuration
class SecurityConfig {                                                    // Security
    @Bean
    SecurityFilterChain api(HttpSecurity http) throws Exception {
        return http.authorizeHttpRequests(a -> a.anyRequest().authenticated())
                   .oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults()))
                   .build();
    }
}
 
@Service
class OrderEvents {
    private final KafkaTemplate<String, OrderPlaced> kafka;               // Kafka
    OrderEvents(KafkaTemplate<String, OrderPlaced> kafka) { this.kafka = kafka; }
    void publish(OrderPlaced e) { kafka.send("orders.placed", e.orderId(), e); }
}
// application.yaml: spring.config.import: optional:configserver:   <- Spring Cloud Config

6.2 A restartable batch job

JAVA
@Bean
Job settlementJob(JobRepository repo, Step settle) {
    return new JobBuilder("settlement", repo).start(settle).build();
}
 
@Bean
Step settle(JobRepository repo, PlatformTransactionManager tx,
            ItemReader<Payment> reader, ItemWriter<Settlement> writer) {
    return new StepBuilder("settle", repo)
            .<Payment, Settlement>chunk(500, tx)       // commit every 500 items
            .reader(reader).processor(Settlement::from).writer(writer)
            .faultTolerant().skipLimit(10).skip(InvalidPaymentException.class)
            .build();
}

7Common Problems & Mistakes

  • Incompatible Boot and Cloud versions. Using a Cloud release train not designed for the Boot line produces startup failures such as missing classes in auto-configuration. Always check the compatibility table.
  • Choosing a project for résumé value. Adding Spring Cloud Gateway, Config Server and Eureka to a three-service system deployed on Kubernetes duplicates what the platform already provides (Ingress/Gateway API, ConfigMaps, DNS discovery).
  • Confusing Spring Integration, Spring Cloud Stream and Spring Kafka. Kafka = Kafka-specific client support; Stream = broker-neutral event-driven microservices; Integration = general EIP toolkit with many protocols.
  • Building on maintenance-mode projects. Starting new work on deprecated libraries creates immediate technical debt.
  • Assuming Boot is required. All projects can be used with the plain Framework; Boot just removes the configuration effort.

8Performance & Production Considerations

ProjectProduction consideration
Spring BootActuator endpoints must be secured; expose only health/info publicly
Spring Data JPAWatch N+1 queries and open-session-in-view (disable spring.jpa.open-in-view)
Spring SecurityFilter-chain cost is small; JWT validation needs cached JWK sets
Spring Cloud GatewayReactive gateway is sensitive to blocking calls in filters
Spring BatchJobRepository database contention at high step concurrency
Spring KafkaConsumer concurrency ≤ partitions; tune max.poll.records against processing time
Spring IntegrationChannel choice (direct vs queue vs executor) controls threading and back-pressure
Table 6 — Production considerations by project

9Architecture & Design Considerations

9.1 Platform-first versus library-first

In Kubernetes environments, many Spring Cloud capabilities overlap with the platform. A useful decision matrix:

CapabilityPlatform optionSpring optionPrefer Spring when…
Service discoveryKubernetes DNS / ServicesEureka, ConsulRunning outside Kubernetes or across clusters
ConfigurationConfigMaps, Secrets, external secret storesSpring Cloud ConfigYou need Git-versioned config with refresh across many apps
Edge routingIngress / Gateway API / service meshSpring Cloud GatewayRouting needs Java-level logic, custom filters or aggregation
ResilienceService mesh retries/timeoutsResilience4j, Framework 7 @RetryableBehaviour depends on business semantics
Table 7 — Platform versus Spring capabilities

9.2 Managing lock-in

The ecosystem's consistency is also its lock-in. Mitigate by keeping domain logic framework-free, using standard protocols (HTTP, OAuth2, Kafka, SQL) at boundaries, and preferring Spring abstractions that wrap standards (JPA, JMS, Micrometer/OpenTelemetry) over proprietary ones.

10Interview Questions & Answers

Q1L1 · BasicConcept

What is the difference between Spring Framework and Spring Boot?

Spring Framework is the foundation and Spring Boot is an opinionated layer on top of it. The Framework provides the IoC container, AOP, Spring MVC and WebFlux, transaction management, data-access integration and the testing support, but it expects you to assemble and configure the pieces yourself. Boot adds starters that pull in compatible dependencies, auto-configuration that registers infrastructure beans when classes and properties are present, an embedded server in an executable JAR, externalised configuration and Actuator for health and metrics. Boot does not replace any Framework concept; a Boot application is still an ApplicationContext full of beans. In practice almost every new service uses Boot, but you debug it with Framework knowledge.

Q2L1 · BasicConcept

What does Spring Data provide?

Spring Data provides a consistent repository abstraction over many stores, so you declare an interface and Spring generates the implementation at startup. Extending ListCrudRepository or PagingAndSortingRepository gives you CRUD, paging and sorting; methods such as findByStatusAndCreatedAfter are parsed into queries from their names, and @Query covers the cases a name cannot express. It also supports projections, auditing fields such as @CreatedDate, and Example-based queries. The same model exists across store modules for JPA, JDBC, R2DBC, MongoDB, Redis, Cassandra, Elasticsearch and Neo4j, each adding store-specific features. The value is removing boilerplate data-access code, but you still need to understand the queries it generates, especially with JPA.

Q3L2 · IntermediateConcept

How do you choose compatible versions of Spring Boot and Spring Cloud?

Choose the Spring Boot version first, then take the Spring Cloud release train that the Spring Cloud project documents as compatible with that Boot line, and import its BOM in dependencyManagement. Boot's dependency management then aligns the Framework, Data, Security, Kafka, Batch and most third-party libraries, while spring-cloud-dependencies aligns the Cloud sub-projects. For example, Boot 4.0 pairs with the 2025.1 Oakwood train and Boot 3.5 with 2025.0. Never pin individual Spring artifact versions by hand. A mismatch usually fails at startup with ClassNotFoundException or NoSuchMethodError inside an auto-configuration class, and Spring Cloud's compatibility verifier reports an unsupported Boot version early, which you should not simply disable.

Q4L2 · IntermediateTrade-off

When would you use Spring Batch instead of a scheduled method?

Use Spring Batch when the work is large or must survive failure. Batch processes data in chunks, committing every N items, and records each job and step execution in a JobRepository, so a job that fails at item 400,000 restarts from the last committed chunk instead of from the beginning. It adds skip and retry policies, execution history for audit, and scaling through multi-threaded steps, partitioning and remote chunking. A @Scheduled method has none of that: if the JVM dies mid-run, you have no record of progress. It is fine for small, idempotent periodic tasks such as cache refreshes. In a cluster, both need a scheduler or lock so only one instance runs.

Q5L3 · Senior EngineerTrade-off

Spring Kafka, Spring Cloud Stream and Spring Integration can all consume Kafka messages. How do you choose?

Choose by how much of Kafka you need to see. Spring for Apache Kafka gives direct control: KafkaTemplate, @KafkaListener, partition assignment, transactions, DefaultErrorHandler with dead-letter publishing and non-blocking retry topics. I use it when Kafka is a deliberate architectural choice and its semantics matter. Spring Cloud Stream hides the broker behind binders and a functional model of Supplier, Function and Consumer beans, which suits many services sharing a convention or a possible broker change, at the cost of indirection when tuning. Spring Integration fits when Kafka is one channel in a wider flow involving files, SFTP, HTTP or JMS, with routing, splitting and transformation. Mixing all three in one service is usually a mistake.

Q6L3 · Senior EngineerInternals

How does an ecosystem project's auto-configuration let you override its defaults?

Ecosystem auto-configuration is written to back off. Most infrastructure beans are declared with @ConditionalOnMissingBean, so if you define your own bean of that type, Boot sees it during condition evaluation and skips its default; that is how a custom DefaultErrorHandler or ObjectMapper replaces the auto-configured one. Ordering matters: auto-configuration classes are processed after user configuration, which is why the check works. For smaller changes, prefer properties such as spring.kafka.consumer.max-poll-records, or Customizer beans such as RestClientCustomizer, which adjust the default instead of replacing it and keep the rest of Boot's wiring. When behaviour surprises you, the conditions report from --debug or the conditions Actuator endpoint shows exactly why each configuration matched.

Q7L4 · Technical ArchitectScenario

On Kubernetes, would you deploy Eureka and Spring Cloud Config Server for a new microservice platform?

Usually not. Kubernetes already gives you service discovery through Services and DNS, configuration through ConfigMaps and Secrets, and rollouts through Deployments, so Eureka and a Config Server add two more stateful components to run, secure and upgrade without adding capability. I would use Spring Cloud Kubernetes or plain environment variables and mounted files, with an external secret store such as Vault or AWS Secrets Manager. I would add Config Server only for a real gap, such as Git-versioned configuration shared by many applications with audited, coordinated refresh, and Eureka or Consul only for discovery across clusters or with workloads outside Kubernetes. The rule is platform first, Spring library second.

Q8L5 · Solution ArchitectDesign

How would you govern Spring ecosystem usage across a large enterprise?

I would treat the ecosystem as a platform product. A platform team publishes an internal BOM that imports spring-boot-dependencies and the matching Spring Cloud train, plus approved internal libraries, so services never choose Spring versions themselves. Alongside it sits an approved project list: standard, allowed with architecture review, and deprecated, such as OpenFeign for new work, each with its lifecycle status. Upgrade SLAs are tied to Spring's open-source support windows, for example staying within one Boot minor of current. Renovate raises upgrade pull requests, OpenRewrite automates migrations, and CI enforces dependency convergence and vulnerability scanning. Reference architectures, internal starters and a dashboard of BOM versions per service make the right path the easy one.

Test your knowledge on this topic →Flashcards from this topic's 8 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.