Spring Data provides projects for a wide range of NoSQL technologies, and Spring Boot provides auto-configuration for the most commonly used ones. Adding the appropriate starter to your project gives you auto-configured connection factories, templates, and repository support out of the box — no boilerplate wiring required. Spring Boot provides auto-configuration for: Cassandra, Couchbase, Elasticsearch, LDAP, MongoDB, Neo4j, and Redis.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.
MongoDB
MongoDB
MongoDB is an open-source NoSQL document database that uses a JSON-like schema instead of traditional table-based relational data.Starter: Or using discrete properties:Auto-configured beans: The domain class uses Spring Data MongoDB annotations:
spring-boot-starter-data-mongodbConnection configuration:application.yaml
application.yaml
MongoDatabaseFactory, MongoTemplate, MongoClientRepository example:CityRepository.java
City.java
Redis
Redis
Redis is a cache, message broker, and richly-featured key-value store. Spring Boot offers auto-configuration for the Lettuce (default) and Jedis client libraries.Starter: Or using a URL:Auto-configured beans: Receiving messages with Enable SSL for Redis connections:
spring-boot-starter-data-redisConnection configuration:application.yaml
application.yaml
RedisConnectionFactory, StringRedisTemplate, RedisTemplateInject and use StringRedisTemplate directly:MyBean.java
@RedisListener:MyBean.java
application.yaml
Elasticsearch
Elasticsearch
Elasticsearch is an open source, distributed, RESTful search and analytics engine.Starter: Spring Boot supports several clients:Mark your domain class as an Elasticsearch document:Enable sniffer for automatic node discovery:
spring-boot-starter-data-elasticsearchConnection configuration:application.yaml
Rest5Client(low-level REST client) — fromco.elastic.clients:elasticsearch-rest5-clientElasticsearchClient(Java API client) — fromco.elastic.clients:elasticsearch-javaReactiveElasticsearchClient— fromorg.springframework.data:spring-data-elasticsearch
CityRepository.java
City.java
application.yaml
Cassandra
Cassandra
Cassandra is an open source, distributed database management system designed to handle large amounts of data across many commodity servers.Starter: Enable SSL:Auto-configured beans:
spring-boot-starter-data-cassandraConnection configuration:application.yaml
application.yaml
CqlTemplate, CassandraTemplate, CqlSessionRepository example:CityRepository.java
Spring Data Cassandra repository support is more limited than JPA repositories and requires
@Query-annotated finder methods for custom queries.Couchbase
Couchbase
Couchbase is an open-source, distributed, multi-model NoSQL document-oriented database optimized for interactive applications.Starter: Auto-configured beans: Configure connection timeouts and SSL with an SSL bundle:
spring-boot-starter-data-couchbaseConnection configuration:application.yaml
Cluster, CouchbaseTemplate, CouchbaseClientFactoryInject CouchbaseTemplate into your beans:MyBean.java
application.yaml
Neo4j
Neo4j
Neo4j is an open-source NoSQL graph database that uses a rich data model of nodes connected by first-class relationships — better suited for highly-connected data than traditional RDBMS.Starter: Auto-configured beans:
spring-boot-starter-data-neo4jConnection configuration:application.yaml
Driver, Neo4jTemplate, ReactiveNeo4jTemplateDefine a node entity and repository:City.java
CityRepository.java
In an application using the reactive style, a
ReactiveTransactionManager is not auto-configured. You must define a ReactiveNeo4jTransactionManager bean explicitly.LDAP
LDAP
Spring Boot offers auto-configuration for any compliant LDAP server as well as support for the embedded in-memory LDAP server from UnboundID.Starter: Auto-configured beans:
spring-boot-starter-data-ldapConnection configuration:application.yaml
LdapContextSource, LdapTemplateFor testing, use the embedded in-memory LDAP server:application.yaml