Using Spring Data and MongoDB with Cloud Foundry
Upcoming SlideShare
Loading in...5

Using Spring Data and MongoDB with Cloud Foundry



Presentation delivered at MongoUK 2011

Presentation delivered at MongoUK 2011



Total Views
Views on SlideShare
Embed Views



3 Embeds 40 31 6 3



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • 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 Using Spring Data and MongoDB with Cloud Foundry Presentation Transcript

  • 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
    • ... until we needed inexpensive horizontal scaling for some large web based applications ...
    • ... and we needed to deploy our apps in the cloud ...
    • image courtesy of Bitcurrent
  • NoSQL offers several data store categories Column Key-Value Document Graph
  • Spring Framework built-in data access support
    • Transaction abstractions
    • Common data access exception hierarchy
    • JDBC - JdbcTemplate
    • ORM - Hibernate, JPA support
    • OXM - Object to XML mapping
    • Serializer/Deserializer strategies (Spring 3.0)
    • Cache support (Spring 3.1)
    • Spring Data Key-value
    • Spring Data Document
    • Spring Data Graph
    • Spring Data Column
    • Spring Data Blob
    • Spring Data JPA Repository / JDBC Extensions
    • Spring Gemfire / Spring Hadoop ...
    • Grails i N c O n S e Q uentia L
  • Spring Data Building Blocks
    • Low level data access APIs
      • MongoTemplate, RedisTemplate ...
    • Object Mapping (Java and GORM)
    • Cross Store Persistence Programming model
    • Generic Repository support
    • Productivity support in Roo and Grails
  • Spring MongoDB
  • Spring Data Document Mongo
    • MongoTemplate
      • MongoConverter interface for mapping Mongo documents
      • SimpleMongoConverter for basic POJO mapping support
      • Leverage Spring 3.0 TypeConverters and SpEL
      • Exception translation
    • Advanced Mapping
      • Annotation based (@Document, @Id, @DbRef)
    • MongoRepository
      • Built on Hades support for JPA Repositories
  • 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) {"age" : { "$gt" : age}} LessThan findByAgeLessThan(int age) {"age" : { "$lt" : age}} Between findByAgeBetween(int from, int to) {"age" : { "$gt" : from, "$lt" : to}} NotNull findByFirstnameNotNull() { ” firstname" : {" $ne" : null}} Null findByFirstnameNull() { ” firstname" : null} Like findByFirstnameLike(String name) " firstname " : firstname } ( regex ) etc….
  • 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 Micro Clouds .js Other Services Msg Services .COM …
  • Cloud Foundry MongoDB Demo