The Wayback Machine - https://web.archive.org/web/20240727210946/https://www.geeksforgeeks.org/introduction-to-the-spring-data-framework/
Open In App

Introduction to the Spring Data Framework

Last Updated : 01 Jun, 2020
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report

In the previous article, we have already discussed about spring framework and spring boot. In this article, we will understand about spring data framework.

The need for Spring Data Framework
Our digital world is holding more than 20 zettabytes of data, and that is around as many bits of information as the stars in our physical universe. These data come from various sources such as Banking, Retail, e-commerce, Education, Construction, social networking sites etc, and available in both the forms (i.e.), structured as well as unstructured. The cost of creating, capturing, storing, and managing these data is the biggest challenge for the industry. There are many software and frameworks which are available in the market that has solved this problem up to some extent. But still these frameworks struggle with issues such as:

  • It is extremely difficult and impossible to scale writes in RDBMS.
  • Scaling it vertically or horizontally has either some limitations or expensive.

This has been solved with NoSQL data which emerged as a point solution with an idea of shifting from ACID(Atomicity, Consistency, Isolation, and Durability) to BASE(Basically Available, Scalable, Eventually Consistent). NoSQL is an ongoing trend and is an option for developers for non-relational databases to use the right tool for the right job. Apart from NoSQL, we do have Big Data which refers to a dataset whose size is beyond the ability of typical database software tools to capture, store, manage and analyze the data. Big data, in almost every industry, ranging from 10’s of TB(Terabyte) to multiple PB(PetaByte).

So, we can observe that the data access landscape has changed considerably. RDBMS is still important but couldn’t be considered as a “One size fits all” solution. We also know that the Spring framework has always provided great support for RDBMS data access but was lacking to deal with other kinds of data access(NoSQL and BigData). So the Spring Data project’s goal is to refresh the Spring data support with all kinds of data technologies(relational data, non-relational data, and Big Data) while retaining store-specific features and capabilities.

Spring Data Framework:

Spring data framework is the parent project which contains many sub-frameworks. All these sub frameworks deal with data access which is specific to a database. The design objective of this framework is to provide a Spring-based familiar and consistent model for all data access technologies like relational or non-relational databases, cloud-based technologies, or map-reduce frameworks. In short Spring Data is an initiative to give Spring developers easy access to the emerging world of NoSQL. Below are the range of technologies that Spring Data support actively.

  1. Relational
    • JPA Extension
    • JDBC Extension
  2. Non-Relational
    • Redis
    • Mongo
    • HBase
    • Neo4J
    • Gemfire
    • Lucene
  3. Query DSL
    • The separate open-source project, that provides type safety for executing queries.
  4. Big Data
    • Hadoop
    • HDFS and M/R
    • Hive
    • Pig
    • Cascading

Few Popular Released Modules in this framework:

Below are some of the major released modules under the Spring Data project:

  1. Spring Data JDBC
  2. Spring Data JPA
  3. Spring Data Commons
  4. Spring Data REST
  5. Spring Data KeyValue
  6. Spring Data MongoDB
  7. Spring Data LDAP
  8. Spring Data Redis
  9. Spring Data for Apache Cassandra
  10. Spring Data for Apache Solr
  11. Spring Data for Apache Geode
  12. Spring Data for Pivotal GemFire

Module under development:

Currently, the spring data R2DBC module is under development. The features of this module are:

  • Repository Support.
  • Resource allocation and exception translation through templates.
  • Object/Datastore Mapping for SQL and NoSQL data stores.
  • Dynamic derived queries from repositories methods name.
  • Transparent auditing support.

Keywords and Definition: Below are some of the key terms and their definitions used in the Spring Data frameworks.

  1. Repositories: Mediates between the data mapping layers and the domain through a collection-like interface for accessing domain objects.
    • Create POJO which will be your model or entity.
    • Extend a repository interface for CRUD operations, and add query methods(finder methods).
    • Configure Spring to scan for repository interfaces and create implementations.
    • Inject implementations into your services.
  2. QueryDSL: Enables the construction of type-safe SQL like queries for multiple backends including MongoDB, Lucence, JPA, JDO, SQL, and plain collection in Java.
  3. NoSQL Data Models: NoSQL data models usually get represented in key-value pairs and it mostly documented either as JSON or as Graphs.
  4. Redis: It is a persistent caching framework work on key-value store. It comes with plenty of features and supports a rich set of data types (String, Binary, Lists, Sets, OrderedSets, HashMap, etc). It can take a periodic snapshot of memory and can append commands to a log file.
  5. HBase: It is a column-oriented database. where Row points to “columns” which are key-value pairs. Columns can be grouped into column families.
  6. MongoDB: It is an open-source, scalable, high-performance, document-oriented JSON-style database, where documents are organized in collections. It is considered as one of the rich query languages for dynamic queries. It has Geospatial features.
  7. Graphs Graphs are a general-purpose data structure. Graphs in the context of data don’t mean for charts, diagram or vector artwork, but has a special meaning for storing data which is structured as a graph.

Finally, we can conclude that the spring data is an umbrella project which has been designed with an intent to unify and ease the access to all kinds of the database system.


Previous Article
Next Article

Similar Reads

Spring Boot - Reactive Programming Using Spring Webflux Framework
In this article, we will explore React programming in Spring Boot, Reactive programming is an asynchronous, non-blocking programming paradigm for developing highly responsive applications that react to external stimuli. What is Reactive ProgrammingIn reactive programming, the flow of data is asynchronous through push-based publishers and subscriber
4 min read
Spring Boot - Spring JDBC vs Spring Data JDBC
Spring JDBC Spring can perform JDBC operations by having connectivity with any one of jars of RDBMS like MySQL, Oracle, or SQL Server, etc., For example, if we are connecting with MySQL, then we need to connect "mysql-connector-java". Let us see how a pom.xml file of a maven project looks like. C/C++ Code <?xml version="1.0" encoding=
4 min read
Introduction to Spring Framework
Prior to the advent of Enterprise Java Beans (EJB), Java developers needed to use JavaBeans to create Web applications. Although JavaBeans helped in the development of user interface (UI) components, they were not able to provide services, such as transaction management and security, which were required for developing robust and secure enterprise a
10 min read
Difference Between Spring DAO vs Spring ORM vs Spring JDBC
The Spring Framework is an application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. Spring-DAO Spring-DAO is not a spring module. It does not provide interfaces or templates
5 min read
Spring vs Spring Boot vs Spring MVC
Are you ready to dive into the exciting world of Java development? Whether you're a seasoned pro or just starting out, this article is your gateway to mastering the top frameworks and technologies in Java development. We'll explore the Spring framework, known for its versatility and lightweight nature, making it perfect for enterprise-level softwar
8 min read
Spring Framework Annotations
Spring framework is one of the most popular Java EE frameworks. It is an open-source lightweight framework that allows Java EE 7 developers to build simple, reliable, and scalable enterprise applications. This framework mainly focuses on providing various ways to help you manage your business objects. Now talking about Spring Annotation, Spring Ann
5 min read
Spring - ORM Framework
Spring-ORM is a technique or a Design Pattern used to access a relational database from an object-oriented language. ORM (Object Relation Mapping) covers many persistence technologies. They are as follows: JPA(Java Persistence API): It is mainly used to persist data between Java objects and relational databases. It acts as a bridge between object-o
2 min read
Top 10 Most Common Spring Framework Mistakes
"A person who never made a mistake never tried anything new" - Well said the thought of Albert Einstein. Human beings are prone to make mistakes. Be it technological aspect, mistakes are obvious. And when we talk about technology, frameworks play a very important role in building web applications. Frameworks have a defined set of codes that can be
6 min read
10 Reasons to Use Spring Framework in Projects
Spring is the season that is known for fresh leaves, new flowers, and joy which makes our minds more creative. Do you know there is a bonus for us? We have another Spring as well. Our very own Spring framework! It is an open-source application framework that is used for building Java applications and projects. There are many reasons for which Sprin
6 min read
Remoting in Spring Framework
Spring has integration classes for remoting support that use a variety of technologies. The Spring framework simplifies the development of remote-enabled services. It saves a significant amount of code by having its own API. The remote support simplifies the building of remote-enabled services, which are implemented by your standard (Spring) POJOs.
3 min read
Practice Tags :
three90RightbarBannerImg