Using Spring and MongoDB with Cloud Foundry Chris Harris, Architect
Spring Data
Data Access Challenge #1: Scale Horizontally
Data Access Challenge #2: Heterogeneous data access needs
New demands on data access <ul><li>... until we needed inexpensive horizontal scaling for some large web based application...
NoSQL offers several data store categories Column Key-Value Document Graph
Spring Framework built-in data access support <ul><li>Transaction abstractions </li></ul><ul><li>Common data access except...
<ul><li>Spring Data Key-value </li></ul><ul><li>Spring Data Document </li></ul><ul><li>Spring Data Graph </li></ul><ul><li...
Spring Data Building Blocks <ul><li>Low level data access APIs </li></ul><ul><ul><li>MongoTemplate, RedisTemplate ... </li...
Spring MongoDB
Spring Data Document Mongo <ul><li>MongoTemplate </li></ul><ul><ul><li>MongoConverter interface for mapping Mongo document...
Simple Domain Class
Mongo Template Direct Usage of the Mongo Template:
Generic Repository  Interface for generic CRUD operations on a repository for a specific type
Paging and Sorting Repository Extends “ CrudRepository ”   Usage: Paging and Sorting Repository:
Custom Repository  Custom Repository:  Keywords :  Keyword Sample Logical result GreaterThan findByAgeGreaterThan(int age)...
Cross Store
JPA and MongoDB  JPA “Customer” with a “ SurveyInfo ”  Document
Using a Cross-Store Saving a Customer with a SurveryInfo Mongo Document:
Cloud Foundry
Choice of clouds Cloud  Provider Interface Application Service Interface Data Services Private  Clouds  Public Clouds Micr...
Cloud Foundry MongoDB Demo
Upcoming SlideShare
Loading in …5
×

Using Spring Data and MongoDB with Cloud Foundry

2,425
-1

Published on

Presentation delivered at MongoUK 2011

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,425
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
50
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • Oracle RAC clustering is very expensive. $70K/CPU according to list. Even at ½ the cost, it’s still really expensive to build out a horizontal data access grid.
  • The amount of log data amassed in Facebook’s operations is staggering. Rothschild said Facebook manages more than 25 terabytes of data per day in logging data, which he said was the equivalent of about 1,000 times the volume of mail delivered daily by the U.S. Postal Service. BASE (basically available, soft state, eventually consistent)
  • Using Spring Data and MongoDB with Cloud Foundry

    1. 1. Using Spring and MongoDB with Cloud Foundry Chris Harris, Architect
    2. 2. Spring Data
    3. 3. Data Access Challenge #1: Scale Horizontally
    4. 4. Data Access Challenge #2: Heterogeneous data access needs
    5. 5. New demands on data access <ul><li>... until we needed inexpensive horizontal scaling for some large web based applications ... </li></ul><ul><li>... and we needed to deploy our apps in the cloud ... </li></ul><ul><li>image courtesy of Bitcurrent </li></ul>
    6. 6. NoSQL offers several data store categories Column Key-Value Document Graph
    7. 7. Spring Framework built-in data access support <ul><li>Transaction abstractions </li></ul><ul><li>Common data access exception hierarchy </li></ul><ul><li>JDBC - JdbcTemplate </li></ul><ul><li>ORM - Hibernate, JPA support </li></ul><ul><li>OXM - Object to XML mapping </li></ul><ul><li>Serializer/Deserializer strategies (Spring 3.0) </li></ul><ul><li>Cache support (Spring 3.1) </li></ul>
    8. 8. <ul><li>Spring Data Key-value </li></ul><ul><li>Spring Data Document </li></ul><ul><li>Spring Data Graph </li></ul><ul><li>Spring Data Column </li></ul><ul><li>Spring Data Blob </li></ul><ul><li>Spring Data JPA Repository / JDBC Extensions </li></ul><ul><li>Spring Gemfire / Spring Hadoop ... </li></ul><ul><li>Grails i N c O n S e Q uentia L </li></ul>
    9. 9. Spring Data Building Blocks <ul><li>Low level data access APIs </li></ul><ul><ul><li>MongoTemplate, RedisTemplate ... </li></ul></ul><ul><li>Object Mapping (Java and GORM) </li></ul><ul><li>Cross Store Persistence Programming model </li></ul><ul><li>Generic Repository support </li></ul><ul><li>Productivity support in Roo and Grails </li></ul>
    10. 10. Spring MongoDB
    11. 11. Spring Data Document Mongo <ul><li>MongoTemplate </li></ul><ul><ul><li>MongoConverter interface for mapping Mongo documents </li></ul></ul><ul><ul><li>SimpleMongoConverter for basic POJO mapping support </li></ul></ul><ul><ul><li>Leverage Spring 3.0 TypeConverters and SpEL </li></ul></ul><ul><ul><li>Exception translation </li></ul></ul><ul><li>Advanced Mapping </li></ul><ul><ul><li>Annotation based (@Document, @Id, @DbRef) </li></ul></ul><ul><li>MongoRepository </li></ul><ul><ul><li>Built on Hades support for JPA Repositories </li></ul></ul>
    12. 12. Simple Domain Class
    13. 13. Mongo Template Direct Usage of the Mongo Template:
    14. 14. Generic Repository Interface for generic CRUD operations on a repository for a specific type
    15. 15. Paging and Sorting Repository Extends “ CrudRepository ” Usage: Paging and Sorting Repository:
    16. 16. Custom Repository Custom Repository: Keywords : Keyword Sample Logical result GreaterThan findByAgeGreaterThan(int age) {&quot;age&quot; : { &quot;$gt&quot; : age}} LessThan findByAgeLessThan(int age) {&quot;age&quot; : { &quot;$lt&quot; : age}} Between findByAgeBetween(int from, int to) {&quot;age&quot; : { &quot;$gt&quot; : from, &quot;$lt&quot; : to}} NotNull findByFirstnameNotNull() { ” firstname&quot; : {&quot; $ne&quot; : null}} Null findByFirstnameNull() { ” firstname&quot; : null} Like findByFirstnameLike(String name) &quot; firstname &quot; : firstname } ( regex ) etc….
    17. 17. Cross Store
    18. 18. JPA and MongoDB JPA “Customer” with a “ SurveyInfo ” Document
    19. 19. Using a Cross-Store Saving a Customer with a SurveryInfo Mongo Document:
    20. 20. Cloud Foundry
    21. 21. Choice of clouds Cloud Provider Interface Application Service Interface Data Services Private Clouds Public Clouds Micro Clouds .js Other Services Msg Services .COM …
    22. 22. Cloud Foundry MongoDB Demo
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×