Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is the purpose of Spring Data and its level of Abstraction?

 
Ranch Hand
Posts: 160
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While trying to understand the purpose of 'Spring Data' i came across this article and tried few examples with Gemfire/ Redis repositories and their corresponding Spring-Data components. Could someone help me with the following questions.

Scenario: When GemFire was my datastore, i had to use methods create, get and remove on the GemFireTemplate to perform the CRUD operations. When Redis was my datastore, I had to use methods .opsForHash().put , .opsForHash().get and .opsForHash().delete on the RedisTemplate to perform the same CRUD operations.

Question:

Isn't Spring-Data supposed to provide a level of abstraction to the underlying data store ? If i am expected to know the respective CRUD methods and have different APIs based on the underlying data store, what kind of abstraction does Spring-Data components bring in ? Can't I directly use a Jedis or Java client for Gemfire to perform these datatstore specific CRUD operations ?



This Article seems to explain that but, looks like i need some help in understanding it.

>> there is no general API to all the persistence stores. The differences are too fundamental. But the Spring Data project does provide a common programming model to access your data <<
 
Ranch Hand
Posts: 43
Spring Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To my understanding, Spring Data does give you a level of abstraction, and faster creation of repositories.

However, if you do customization or native commands (e.g. queries) in your repositories, then those are not portable to other database systems.

If you try to stay within those common supplied methods etc., then it will be transparent when changing database systems.
 
Right! We're on it! Let's get to work tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic