Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/spring-projects/spring-boot/llms.txt

Use this file to discover all available pages before exploring further.

Spring Boot data starters give you pre-configured access to relational databases, document stores, key-value caches, graph databases, search engines, and batch processing frameworks. Each starter combines the Spring Data or Spring Framework integration module with the required client library and auto-configuration, so your application connects and runs with only a few properties in application.properties.

Relational database starters

spring-boot-starter-jdbc

Plain JDBC access using JdbcTemplate with HikariCP as the connection pool. This is the lowest-level relational starter — no ORM, no query DSL, just SQL.Includes: spring-boot-starter · spring-boot-jdbc · HikariCP
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
You must also add a JDBC driver for your database:
Maven — H2 driver (example)
<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <scope>runtime</scope>
</dependency>
When to use: When you want full SQL control without an ORM, or when you need maximum query transparency and minimal overhead.
Spring Data JDBC: a lightweight ORM alternative that maps entities to tables without lazy loading, caching, or a session concept.Includes: spring-boot-starter · spring-boot-starter-jdbc · spring-boot-data-jdbc · spring-boot-jdbc
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
When to use: When you want repository abstractions (CrudRepository, ListCrudRepository) over a relational database but prefer simpler, aggregate-based persistence without JPA’s full complexity.
Full JPA with Hibernate: the most feature-rich relational starter, supporting entity relationships, JPQL, the criteria API, first-level cache, and lazy loading.Includes: spring-boot-starter · spring-boot-starter-jdbc · spring-boot-data-jpa · spring-boot-jdbc
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
A minimal JPA entity and repository:
@Entity
public class Product {
    @Id @GeneratedValue
    private Long id;
    private String name;
    private BigDecimal price;
    // getters, setters
}

public interface ProductRepository extends JpaRepository<Product, Long> {
    List<Product> findByPriceLessThan(BigDecimal maxPrice);
}
When to use: Domain models with complex relationships (one-to-many, many-to-many), when you want derived query methods, or when migrating from an existing Hibernate application.
Type-safe SQL using the jOOQ DSL, which generates Java classes from your schema so your queries are checked at compile time.Includes: spring-boot-starter · spring-boot-starter-jdbc · spring-boot-jooq · spring-boot-jdbc
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jooq</artifactId>
</dependency>
When to use: Complex SQL queries where you want compile-time safety but not an ORM. Works well alongside Spring Data repositories for simpler reads.

Reactive relational starter

spring-boot-starter-data-r2dbc

Non-blocking relational database access using R2DBC (Reactive Relational Database Connectivity) and Spring Data R2DBC. Includes: spring-boot-starter · spring-boot-data-r2dbc · spring-boot-r2dbc · spring-boot-reactor
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-r2dbc</artifactId>
</dependency>
You must also add a reactive R2DBC driver, for example:
Gradle — PostgreSQL R2DBC driver
runtimeOnly 'org.postgresql:r2dbc-postgresql'
When to use: Reactive applications built on Spring WebFlux that need relational database access without blocking threads.
R2DBC is not a drop-in replacement for JPA. It does not support entity relationships or lazy loading. Model your domain around Spring Data R2DBC’s simpler aggregate-based conventions.

Document store starters

spring-boot-starter-data-mongodb

MongoDB via Spring Data MongoDB (synchronous). Auto-configures MongoClient and MongoTemplate.

spring-boot-starter-data-cassandra

Apache Cassandra via Spring Data Cassandra. Auto-configures CqlSession and CassandraTemplate.
MongoDB document database with Spring Data MongoDB repositories and MongoTemplate.Includes: spring-boot-starter-mongodb · spring-boot-data-mongodb
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
Configure the connection in application.properties:
application.properties
spring.data.mongodb.uri=mongodb://localhost:27017/mydb
When to use: Flexible document schemas, embedded arrays and objects, or when you need MongoDB’s aggregation pipeline.
Apache Cassandra distributed database with Spring Data Cassandra.Includes: spring-boot-starter · spring-boot-cassandra · spring-boot-data-cassandra
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>
application.properties
spring.cassandra.contact-points=localhost
spring.cassandra.keyspace-name=mykeyspace
spring.cassandra.local-datacenter=datacenter1
When to use: High-write, time-series, or IoT workloads requiring linear horizontal scalability and no single point of failure.

Key-value and cache starters

spring-boot-starter-data-redis

Redis key-value store with Spring Data Redis using the Lettuce client (async, thread-safe). Includes: spring-boot-starter · spring-boot-data-redis · spring-messaging
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
application.properties
spring.data.redis.host=localhost
spring.data.redis.port=6379
When to use: Session storage, distributed caching (@Cacheable), pub/sub messaging, rate limiting, or Lua-scripted atomic operations.
To use the Jedis client instead of Lettuce, exclude lettuce-core and add jedis to your dependencies. Both clients are fully supported.

Search and analytics starters

spring-boot-starter-data-elasticsearch

Elasticsearch full-text search and analytics with Spring Data Elasticsearch. Includes: spring-boot-starter · spring-boot-data-elasticsearch · spring-boot-elasticsearch · spring-boot-starter-jackson (runtime)
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
application.properties
spring.elasticsearch.uris=http://localhost:9200
When to use: Full-text search, faceted search, log and event analytics, or geospatial queries.

Graph database starters

spring-boot-starter-data-neo4j

Neo4j graph database with Spring Data Neo4j. Includes: spring-boot-starter · spring-boot-data-neo4j · spring-boot-neo4j
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-neo4j</artifactId>
</dependency>
application.properties
spring.neo4j.uri=bolt://localhost:7687
spring.neo4j.authentication.username=neo4j
spring.neo4j.authentication.password=secret
When to use: Data with highly connected relationships (social graphs, recommendation engines, knowledge graphs, fraud detection).

Batch processing starter

spring-boot-starter-batch

Spring Batch: enterprise-grade batch processing with jobs, steps, readers, processors, and writers. Includes: spring-boot-starter · spring-boot-batch
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-batch</artifactId>
</dependency>
Spring Batch persists job execution state in a database. Add a JDBC starter and driver alongside it:
Gradle — batch with H2 for dev
implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
runtimeOnly 'com.h2database:h2'
When to use: ETL pipelines, scheduled report generation, bulk data imports/exports, or any processing job that needs restart/retry semantics and auditable execution history.
Spring Batch includes a test module. Add spring-boot-starter-batch-test in test scope to get @SpringBatchTest and JobLauncherTestUtils for integration testing your jobs without a full application context.

Choosing a data starter

Plain SQL + full control

spring-boot-starter-jdbc

SQL with repository pattern

spring-boot-starter-data-jpa

SQL, type-safe DSL

spring-boot-starter-jooq

Reactive SQL

spring-boot-starter-data-r2dbc

Document store

spring-boot-starter-data-mongodb

Key-value / cache

spring-boot-starter-data-redis

Build docs developers (and LLMs) love