Introduction to the Spring Data Framework (original) (raw)

Last Updated : 28 Aug, 2025

Spring Data is a data access framework in the Spring ecosystem that simplifies database interactions for relational (SQL) and non-relational (NoSQL) databases. It eliminates boilerplate code and provides an easy-to-use abstraction layer for developers working with JPA, MongoDB and more.

spring_data

Spring-Data

Need for Spring Data Framework

**Spring Data Framework was introduced to bridge the gap between traditional and modern data storage solutions. It provides:

Spring Data Framework Components

Spring Data is a parent project that consists of multiple submodules, each designed for specific database types.

1. Relational Database Support (SQL-based)

2. NoSQL Database Support

3. Big Data Support

Spring Data includes several widely used modules:

**Below modules are under development:

Currently, Spring Data R2DBC (Reactive Relational Database Connectivity) is evolving to provide:

Key Terms in Spring Data

1. Repositories

A repository is an abstraction layer between domain models and the database. It enables CRUD operations without writing SQL queries manually.

**Steps to Use a Repository:

  1. Create a POJO entity representing the data model.
  2. Extend JpaRepository, CrudRepository or MongoRepository.
  3. Define custom query methods using Spring Data Query Methods.
  4. Inject the repository into services and use it for database operations.

2. QueryDSL

A type-safe way to build dynamic queries for SQL, JPA, MongoDB and Lucene.

3. NoSQL Data Models

NoSQL databases store data in key-value, document, column-family or graph-based formats:

Related Article