Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Spring Data - Intro (Odessa Java TechTalks)

2.260 Aufrufe

Veröffentlicht am

Igor Anishchenko
Odessa Java TechTalks
Lohika - September, 2012

This session starts with a high-level look at all that the Spring Data project has to offer.
Then we’ll dive deeper into a few select Spring Data modules, including Spring Data JPA, Spring Data MongoDB and Spring Data Redis.
Implementing a data access layer of an application has been cumbersome for quite a while. Too much boilerplate code had to be written!
Spring Data is a project that makes it easier to build Spring-powered applications that use new data, offering a reasonably consistent programming model regardless of which type of database you choose.
In addition to supporting the new “NoSQL” databases such as document and graph databases, Spring Data also greatly simplifies working with RDBMS-oriented datastores using JPA -simplifies the development of creating a JPA-based data access layer.

Veröffentlicht in: Technologie
  • DOWNLOAD FULL. BOOKS INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Antworten 
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier

Spring Data - Intro (Odessa Java TechTalks)

  1. 1. Spring Data Igor Anishchenko Lohika - September, 2012
  2. 2. RelationalDatabase
  3. 3. Clouds
  4. 4. Scaling
  5. 5. Column families
  6. 6. Graphs
  7. 7. Key Value
  8. 8. Documents
  9. 9. MongoDBDocument Database JSON documents JSON queries
  10. 10. MongoDBThe most important difference is the data model:
  11. 11. Mongo data modelA Mongo system (see deployment above) holds a setof databases A database holds a set of collections A collection holds a set of documents A document is a set of fields A field is a key-value pair A key is a name (string) A value is a basic type likestring, integer, float, timestamp, binary, etc., a document, or an array of values
  12. 12. MongoDB• Flexible data model• Data can be inserted without a defined schema, and the format of the data being inserted can change at any time• Easy scalability• Databases automatically spreads data across servers, requiring no participation from the applications.• Servers can be added and removed without downtime
  13. 13. Mongo InfrastructureAPI
  14. 14. Mongo Query API
  15. 15. JPA?
  16. 16. " This document is the specification of theJava API for the management of persistenceand object/relational mapping with Java EEand Java SE. The technical objective of thiswork is to provide an object/relationalmapping facility for the Java applicationdeveloper using a Java domain model to man-age a relational database.
  17. 17. " This document is the specification of theJava API for the management of persistenceand object/relational mapping with JavaEE and Java SE. The technical objective ofthis work is to provide anobject/relational mapping facility forthe Java application developer using a Javadomain model to man- age a relationaldatabase.
  18. 18. JPA?
  19. 19. Decision Time? As a developer - what are you looking for?
  20. 20. Spring Data
  21. 21. Mission statement“… provides a familiar andconsistent Spring-based programmingmodel for NoSQL and relational storeswhile retaining store-specificfeatures and capabilities”
  22. 22. ... history• The Spring Data project was coined at 2010• Originated by Rod Johnson (SpringSource) and Neo Technologies) early that year• They were trying to integrate the Neo4j graph database with the Spring framework and evaluated different approaches• Current version
  23. 23. Spring Data JDBC JPA support for relational stores...
  24. 24. Spring Data JDBC JPA support for relational stores...
  25. 25. Spring Data JDBC JPA support for relational stores...
  26. 26. Spring Data JDBC JPA support for relational stores...
  27. 27. Spring Data JDBC JPA support for relational stores...
  28. 28. Core componentsBuilding blocks of Spring Data modules
  29. 29. Spring Core• IoC/DI• Spring namespace• Configuring resources to access the stores• Integration with core Spring functionality like JMX is provided which means that some stores will expose statistics through their native API
  30. 30. Mapping
  31. 31. ...Mapping• A very core part of the Spring Data modules is a mapping and conversion API that allows obtaining meta-data about domain classes• Most of the NoSQL Java APIs do not provide support to map domain objects onto the stores data abstractions• With native Java drivers You would usually have to write a significant amount of code to map data onto your domain objects
  32. 32. JPA - Entitymapping
  33. 33. Entity mapping - MongoDB
  34. 34. Templates
  35. 35. ... Templates• Heavily used in spring (JdbcTemplate, JmsTemplate)• JdbcTemplate - simplifies the use of JDBC and helps to: • avoid common errors • executes core JDBC workflow • SQL queries or updates, iteration over ResultSets and • catching JDBC exceptions• Spring takes this concept and provided templates for noSQL stores • RedisTemplate • MongoTemplate• Offer helper methods that allow us to execute commonly needed operations like persisting an object with a single statement while automatically taking care of appropriate resource management and exception translation
  36. 36. MongoTemplate usage
  37. 37. MongoOperation/-Template
  38. 38. Repositories
  39. 39. GenericDao
  40. 40. ... Repositories• Provides a repository abstraction on top of the Template implementation• Will reduce the effort to implement data access objects to a plain interface definition for the most common scenarios like standard CRUD operations as well as executing queries in case the store supports that.• This abstraction is actually the most top layer and blends the APIs of the different stores as much as reasonably possible.• Interface based programming model, so you have an interface for the queries you want to trigger and then those methods will be generated without a need to implement this interface
  41. 41. Repositories - JPA
  42. 42. Repositories -MongoDB
  43. 43. Querydsl
  44. 44. DEMO
  45. 45. Summary• Abstraction over stores drivers• Mapping support• Templates• Repositories / custom repositories• Querydsl• Spring namespace• Cross-store persistence
  46. 46. ? ? ?? ? ?
  47. 47. Resourceswww.springframework.org/spring-datahttp://github.com/SpringSource/spring-data-mongodbOReillys Open Feedback Publishing System is the book:http://ofps.oreilly.com/titles/9781449323950/http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis

×