SlideShare a Scribd company logo
Using Spring and MongoDB with
CloudFoundry

Josh Long
@starbuxman
Spring Developer Advocate
SpringSource, a division of VMware




                                     © 2009 VMware Inc. All rights reserved
About Josh Long


                  Spring Developer Advocate

                  @starbuxman
                  josh.long@springsource.com




                                         th
                                           si
                                            is
                                                im
                                                 po
                                                     rta
                                                      nt
                                                        !
                                    Free Book!
                                    SpringSource.org/roo




                                                            2
Spring




         3
Spring’s aim:
 bring simplicity to Java development
                                                             data
  web tier                                  integration
                                batch                       access
    &        service tier                        &                           mobile
                             processing                   / NoSQL /
   RIA                                      messaging
                                                          Big Data


                            The Spring framework
the cloud:                    lightweight                    traditional
     CloudFoundry                                                  WebSphere
                                          tc Server
       VMForce                                                      JBoss AS
                                           Tomcat
   Google App Engine                                               WebLogic
                                             Jetty
  Amazon Web Services                                          (on legacy versions, too!)




                                                                                            4
Spring Data




              5
Data Access Challenge #1: Scale Horizontally




                                               6
Data Access Challenge #2: Heterogeneous data access needs




                                                            7
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   8
NoSQL offers several data store categories




Key-Value       Column          Document     Graph




  Redis,         Cassandra,       MongoDB    Neo4J
  Riak           HBase




                                                     9
NoSQL offers several data store categories




Key-Value       Column          Document                        Graph




                                  MongoDB
                                  (who cares about the rest?)




                                                                    10
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)

                                                   11
http://www.springsource.org/spring-data

•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 iNcOnSeQuentiaL
                                                12
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

                                             13
Spring MongoDB




                 14
Spring Data Document
                Mongo
•MongoTemplate interface for mapping Mongo documents
  •MongoConverter
  •SimpleMongoConverter for basic POJO mapping support
  •Leverage Spring 3.0 TypeConverters and SpEL
  •Exception translation
•Advanced Mapping(@Document, @Id, @DbRef)
  •Annotation based
•MongoRepository
  •Built on Hades support for JPA Repositories
                                                         15
Simple Domain Class




                      16
Mongo Template

Direct Usage of the Mongo Template:




                                      17
Mongo Template

Direct Usage of the Mongo Template:




                 Insert into “Person”
                     Collection




                                        17
Mongo Template

Direct Usage of the Mongo Template:




           findOne using query: { "name" : "Joe"}
              in db.collection: database.Person




                                                    17
Mongo Template

Direct Usage of the Mongo Template:




          Dropped collection [database.person]




                                                 17
Generic Repository

Interface for generic CRUD operations on a repository for a specific type




                                                                            18
Paging and Sorting Repository


Paging and Sorting Repository:   Extends “CrudRepository”




                                                            19
Paging and Sorting Repository


Paging and Sorting Repository:   Extends “CrudRepository”




 Usage:




                                                            19
Custom Repository

Custom Repository:




                     20
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)
                                                                                 20
Cross Store




              21
JPA and MongoDB

 JPA “Customer” with a “SurveyInfo” Document




                                               22
Using a Cross-Store

  Saving a Customer with a SurveryInfo




                                         23
Using a Cross-Store

  Saving a Customer with a SurveryInfo
                           Create Customer




                                             23
Using a Cross-Store

  Saving a Customer with a SurveryInfo

                            Create SurveyInfo




                                                23
Using a Cross-Store

  Saving a Customer with a SurveryInfo




             Assign Survey to Customer




                                         23
Using a Cross-Store

  Saving a Customer with a SurveryInfo




                         Save




                                         23
Using a Cross-Store

  Saving a Customer with a SurveryInfo




                         Save




  Mongo Document:




                                         23
Cloud Foundry




                24
Cloud Foundry

   github.com/cloudfoundry
   cloudfoundry.org
   @cloudfoundry
   Supports:
    • Languages: Java, Scala, Node.js, Grails, Ruby/Rails/Sinatra, etc.
    • Services: MongoDB, Redis, MySQL, PostgreSQL, RabbitMQ
 ecosystem forks:
    • AppFog - PHP
    • Stacato: Python, Perl, etc., from ActiveState




                                                                          25
Choice of clouds




                                                               .js




                                                                       ce
                                                                     rfa
                       Ap




                                                                   te
         Data                                                              Private
                          p




                                                                 In
                              lic

        Services
                                                                           Clouds




                                                               er
                               at
                                io




                                                              vid
                                    n



                                                                     Public


                                                            o
                                    Se



                     Msg




                                                         Pr
                   Services
                                       r



                                                                     Clouds
                                          vic




                                                          d
                                                        ou
                                              e
                                             In


                                                      Cl

                                                              Micro
                                               te




                                Other
                                                  r




                               Services
                                                              Clouds
                                                  fa
                                                   e c




                                                                                     26
Choice of clouds




                                                               .js




                                                                       ce
                                                                     rfa
                       Ap




                                                                   te
         Data                                                              Private
                          p




                                                                 In
                              lic

        Services
                                                                           Clouds
                                                                                            …



                                                               er
                               at
                                io




                                                              vid
                                    n



                                                                     Public


                                                            o
                                    Se



                     Msg




                                                         Pr
                   Services
                                       r



                                                                     Clouds
                                          vic




                                                          d
                                                        ou
                                              e
                                             In




                                                                                     .COM
                                                      Cl

                                                              Micro
                                               te




                                Other
                                                  r




                               Services
                                                              Clouds
                                                  fa
                                                   e c




                                                                                            26
Setting up Cloud Foundry Demo




                                27
Accessing Services Bound to Cloud Foundry (producer)

private String mongoDatabaseServiceName = "survey-mongo";

@Bean
public CloudEnvironment cloudEnvironment() {
	   return new CloudEnvironment();
}

@Bean
public MongoServiceInfo mongoServiceInfo() {
	   return cloudEnvironment().getServiceInfo(
       mongoDatabaseServiceName, MongoServiceInfo.class);
}

@Bean
public MongoDbFactory mongoDbFactory() {
	   MongoServiceCreator msc = new MongoServiceCreator();
	   MongoDbFactory db = msc.createService(mongoServiceInfo());
}


                                                                 28
Accessing Services Bound to Cloud Foundry (consumption)


@Inject private Mongo mongo ;

@Inject private MongoTemplate mongoTemplate;




                                                          29
Cloud Foundry MongoDB Demo




                             30
Where to Find More

 Spring Data Project:
 http://bit.ly/spring-data
 CloudFoundry Samples:
 http://bit.ly/cloudfoundry-samples
 MicroCloud Foundry for Spring Developers
 http://bit.ly/mcf4spring
 Spring Data Mongo on Cloud Foundry (webinar, 12/01/2011)
 http://bit.ly/spring-mongo-cloudfoundry




                                                             31

More Related Content

What's hot (13)

PDF
MongodB Internals
Norberto Leite
 
PDF
FIWARE Global Summit - Hands-On NGSI-LD
FIWARE
 
PPTX
EBS and RBS in SharePoint 2010
Chris Geier
 
KEY
Managing Social Content with MongoDB
MongoDB
 
PDF
FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...
FIWARE
 
PDF
Performance analysis of MongoDB and HBase
SindhujanDhayalan
 
PPTX
MongoDB et Hadoop
MongoDB
 
PPTX
Database Trends for Modern Applications: Why the Database You Choose Matters
MongoDB
 
PPTX
Python and MongoDB as a Market Data Platform by James Blackburn
PyData
 
PPTX
Transitioning from SQL to MongoDB
MongoDB
 
PPTX
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB
 
PPT
Mongo-Drupal
Forest Mars
 
PDF
Mongo db halloween party
Andrea Balducci
 
MongodB Internals
Norberto Leite
 
FIWARE Global Summit - Hands-On NGSI-LD
FIWARE
 
EBS and RBS in SharePoint 2010
Chris Geier
 
Managing Social Content with MongoDB
MongoDB
 
FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...
FIWARE
 
Performance analysis of MongoDB and HBase
SindhujanDhayalan
 
MongoDB et Hadoop
MongoDB
 
Database Trends for Modern Applications: Why the Database You Choose Matters
MongoDB
 
Python and MongoDB as a Market Data Platform by James Blackburn
PyData
 
Transitioning from SQL to MongoDB
MongoDB
 
MongoDB World 2018: Bumps and Breezes: Our Journey from RDBMS to MongoDB
MongoDB
 
Mongo-Drupal
Forest Mars
 
Mongo db halloween party
Andrea Balducci
 

Viewers also liked (10)

PDF
Extending spring
Joshua Long
 
PDF
The spring 32 update final
Joshua Long
 
PDF
Spring in-the-cloud
Joshua Long
 
KEY
Multi Client Development with Spring
Joshua Long
 
KEY
Integration and Batch Processing on Cloud Foundry
Joshua Long
 
PDF
Boot It Up
Joshua Long
 
PDF
Bootiful Code with Spring Boot
Joshua Long
 
PDF
Economies of Scaling Software
Joshua Long
 
PDF
REST APIs with Spring
Joshua Long
 
PDF
Microservices with Spring Boot
Joshua Long
 
Extending spring
Joshua Long
 
The spring 32 update final
Joshua Long
 
Spring in-the-cloud
Joshua Long
 
Multi Client Development with Spring
Joshua Long
 
Integration and Batch Processing on Cloud Foundry
Joshua Long
 
Boot It Up
Joshua Long
 
Bootiful Code with Spring Boot
Joshua Long
 
Economies of Scaling Software
Joshua Long
 
REST APIs with Spring
Joshua Long
 
Microservices with Spring Boot
Joshua Long
 
Ad

Similar to using Spring and MongoDB on Cloud Foundry (20)

PDF
CloudFoundry and MongoDb, a marriage made in heaven
Patrick Chanezon
 
PPTX
How to use NoSQL in Enterprise Java Applications - NoSQL Roadshow Zurich
Patrick Baumgartner
 
PPT
Wmware NoSQL
Murat Çakal
 
PDF
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
Chris Richardson
 
PDF
Spring Data NHJUG April 2012
trisberg
 
PPTX
Drill dchug-29 nov2012
MapR Technologies
 
KEY
Spring in the Cloud - using Spring with Cloud Foundry
Joshua Long
 
PPTX
Lviv EDGE 2 - NoSQL
zenyk
 
PPTX
An Introduction to Big Data, NoSQL and MongoDB
William LaForest
 
PPTX
Anti-social Databases
William LaForest
 
KEY
A Walking Tour of (almost) all of Springdom
Joshua Long
 
PDF
No SQL Technologies
Cris Holdorph
 
PDF
An Introduction to Spring Data
Oliver Gierke
 
PPT
Java overview the piramide of success
Artem Bilan
 
PDF
Spring Into the Cloud
Jennifer Hickey
 
PDF
SQL, NoSQL, NewSQL? What's a developer to do?
Chris Richardson
 
PDF
MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB
 
PDF
Post-relational databases: What's wrong with web development? v3
Dobrica Pavlinušić
 
PDF
Brandon
Brandon Smith
 
PDF
MongoDB for Java Developers with Spring Data
Chris Richardson
 
CloudFoundry and MongoDb, a marriage made in heaven
Patrick Chanezon
 
How to use NoSQL in Enterprise Java Applications - NoSQL Roadshow Zurich
Patrick Baumgartner
 
Wmware NoSQL
Murat Çakal
 
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
Chris Richardson
 
Spring Data NHJUG April 2012
trisberg
 
Drill dchug-29 nov2012
MapR Technologies
 
Spring in the Cloud - using Spring with Cloud Foundry
Joshua Long
 
Lviv EDGE 2 - NoSQL
zenyk
 
An Introduction to Big Data, NoSQL and MongoDB
William LaForest
 
Anti-social Databases
William LaForest
 
A Walking Tour of (almost) all of Springdom
Joshua Long
 
No SQL Technologies
Cris Holdorph
 
An Introduction to Spring Data
Oliver Gierke
 
Java overview the piramide of success
Artem Bilan
 
Spring Into the Cloud
Jennifer Hickey
 
SQL, NoSQL, NewSQL? What's a developer to do?
Chris Richardson
 
MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB
 
Post-relational databases: What's wrong with web development? v3
Dobrica Pavlinušić
 
Brandon
Brandon Smith
 
MongoDB for Java Developers with Spring Data
Chris Richardson
 
Ad

More from Joshua Long (18)

PDF
Have You Seen Spring Lately?
Joshua Long
 
PDF
Java Configuration Deep Dive with Spring
Joshua Long
 
PDF
the Spring Update from JavaOne 2013
Joshua Long
 
PDF
Multi Client Development with Spring for SpringOne 2GX 2013 with Roy Clarkson
Joshua Long
 
PDF
the Spring 4 update
Joshua Long
 
KEY
Multi Client Development with Spring
Joshua Long
 
KEY
The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
Joshua Long
 
KEY
Multi client Development with Spring
Joshua Long
 
KEY
Spring Batch Behind the Scenes
Joshua Long
 
KEY
Cloud Foundry Bootcamp
Joshua Long
 
PPT
Spring and Cloud Foundry; a Marriage Made in Heaven
Joshua Long
 
PPT
Spring 3.1: a Walking Tour
Joshua Long
 
PDF
Extending Spring for Custom Usage
Joshua Long
 
PPT
Using Spring's IOC Model
Joshua Long
 
PPT
Enterprise Integration and Batch Processing on Cloud Foundry
Joshua Long
 
PDF
a Running Tour of Cloud Foundry
Joshua Long
 
PDF
Cloud Foundry, Spring and Vaadin
Joshua Long
 
PDF
Messaging sz
Joshua Long
 
Have You Seen Spring Lately?
Joshua Long
 
Java Configuration Deep Dive with Spring
Joshua Long
 
the Spring Update from JavaOne 2013
Joshua Long
 
Multi Client Development with Spring for SpringOne 2GX 2013 with Roy Clarkson
Joshua Long
 
the Spring 4 update
Joshua Long
 
Multi Client Development with Spring
Joshua Long
 
The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
Joshua Long
 
Multi client Development with Spring
Joshua Long
 
Spring Batch Behind the Scenes
Joshua Long
 
Cloud Foundry Bootcamp
Joshua Long
 
Spring and Cloud Foundry; a Marriage Made in Heaven
Joshua Long
 
Spring 3.1: a Walking Tour
Joshua Long
 
Extending Spring for Custom Usage
Joshua Long
 
Using Spring's IOC Model
Joshua Long
 
Enterprise Integration and Batch Processing on Cloud Foundry
Joshua Long
 
a Running Tour of Cloud Foundry
Joshua Long
 
Cloud Foundry, Spring and Vaadin
Joshua Long
 
Messaging sz
Joshua Long
 

Recently uploaded (20)

PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Digital Circuits, important subject in CS
contactparinay1
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 

using Spring and MongoDB on Cloud Foundry

  • 1. Using Spring and MongoDB with CloudFoundry Josh Long @starbuxman Spring Developer Advocate SpringSource, a division of VMware © 2009 VMware Inc. All rights reserved
  • 2. About Josh Long Spring Developer Advocate @starbuxman [email protected] th si is im po rta nt ! Free Book! SpringSource.org/roo 2
  • 3. Spring 3
  • 4. Spring’s aim: bring simplicity to Java development data web tier integration batch access & service tier & mobile processing / NoSQL / RIA messaging Big Data The Spring framework the cloud: lightweight traditional CloudFoundry WebSphere tc Server VMForce JBoss AS Tomcat Google App Engine WebLogic Jetty Amazon Web Services (on legacy versions, too!) 4
  • 6. Data Access Challenge #1: Scale Horizontally 6
  • 7. Data Access Challenge #2: Heterogeneous data access needs 7
  • 8. 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 8
  • 9. NoSQL offers several data store categories Key-Value Column Document Graph Redis, Cassandra, MongoDB Neo4J Riak HBase 9
  • 10. NoSQL offers several data store categories Key-Value Column Document Graph MongoDB (who cares about the rest?) 10
  • 11. 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) 11
  • 12. http://www.springsource.org/spring-data •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 iNcOnSeQuentiaL 12
  • 13. 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 13
  • 15. Spring Data Document Mongo •MongoTemplate interface for mapping Mongo documents •MongoConverter •SimpleMongoConverter for basic POJO mapping support •Leverage Spring 3.0 TypeConverters and SpEL •Exception translation •Advanced Mapping(@Document, @Id, @DbRef) •Annotation based •MongoRepository •Built on Hades support for JPA Repositories 15
  • 17. Mongo Template Direct Usage of the Mongo Template: 17
  • 18. Mongo Template Direct Usage of the Mongo Template: Insert into “Person” Collection 17
  • 19. Mongo Template Direct Usage of the Mongo Template: findOne using query: { "name" : "Joe"} in db.collection: database.Person 17
  • 20. Mongo Template Direct Usage of the Mongo Template: Dropped collection [database.person] 17
  • 21. Generic Repository Interface for generic CRUD operations on a repository for a specific type 18
  • 22. Paging and Sorting Repository Paging and Sorting Repository: Extends “CrudRepository” 19
  • 23. Paging and Sorting Repository Paging and Sorting Repository: Extends “CrudRepository” Usage: 19
  • 25. 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) 20
  • 27. JPA and MongoDB JPA “Customer” with a “SurveyInfo” Document 22
  • 28. Using a Cross-Store Saving a Customer with a SurveryInfo 23
  • 29. Using a Cross-Store Saving a Customer with a SurveryInfo Create Customer 23
  • 30. Using a Cross-Store Saving a Customer with a SurveryInfo Create SurveyInfo 23
  • 31. Using a Cross-Store Saving a Customer with a SurveryInfo Assign Survey to Customer 23
  • 32. Using a Cross-Store Saving a Customer with a SurveryInfo Save 23
  • 33. Using a Cross-Store Saving a Customer with a SurveryInfo Save Mongo Document: 23
  • 35. Cloud Foundry  github.com/cloudfoundry  cloudfoundry.org  @cloudfoundry  Supports: • Languages: Java, Scala, Node.js, Grails, Ruby/Rails/Sinatra, etc. • Services: MongoDB, Redis, MySQL, PostgreSQL, RabbitMQ  ecosystem forks: • AppFog - PHP • Stacato: Python, Perl, etc., from ActiveState 25
  • 36. Choice of clouds .js ce rfa Ap te Data Private p In lic Services Clouds er at io vid n Public o Se Msg Pr Services r Clouds vic d ou e In Cl Micro te Other r Services Clouds fa e c 26
  • 37. Choice of clouds .js ce rfa Ap te Data Private p In lic Services Clouds … er at io vid n Public o Se Msg Pr Services r Clouds vic d ou e In .COM Cl Micro te Other r Services Clouds fa e c 26
  • 38. Setting up Cloud Foundry Demo 27
  • 39. Accessing Services Bound to Cloud Foundry (producer) private String mongoDatabaseServiceName = "survey-mongo"; @Bean public CloudEnvironment cloudEnvironment() { return new CloudEnvironment(); } @Bean public MongoServiceInfo mongoServiceInfo() { return cloudEnvironment().getServiceInfo( mongoDatabaseServiceName, MongoServiceInfo.class); } @Bean public MongoDbFactory mongoDbFactory() { MongoServiceCreator msc = new MongoServiceCreator(); MongoDbFactory db = msc.createService(mongoServiceInfo()); } 28
  • 40. Accessing Services Bound to Cloud Foundry (consumption) @Inject private Mongo mongo ; @Inject private MongoTemplate mongoTemplate; 29
  • 42. Where to Find More  Spring Data Project: http://bit.ly/spring-data  CloudFoundry Samples: http://bit.ly/cloudfoundry-samples  MicroCloud Foundry for Spring Developers http://bit.ly/mcf4spring  Spring Data Mongo on Cloud Foundry (webinar, 12/01/2011)  http://bit.ly/spring-mongo-cloudfoundry 31

Editor's Notes

  • #2: \n
  • #3: Hello, thank you or having me. Im pleased to have the opportunity to introduce you today to Spring and the SpringSource Tool Suite \n\nMy anem is Josh Long. I serve as the developer advocate for the Spring framework. I’ve used it in earnest and advocated it for many years now. i’m an author on 3 books on the technology, as well as a comitter to many of the Spring projects. Additionally, I take community activism very seriously and do my best to participate in the community. Sometimes this means answering question on Twitter, or in the forums, or helping contribute to the InfoQ.com and Artima.com communities\n
  • #4: \n
  • #5: these different framerworks let u tackle any problem youre likely to want to solve today \n- we support javee1.4 + 1.5 + 1.6; \n\nsits above target platform \nruns in cloud \n\n
  • #6: \n
  • #7: 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. \n
  • #8: 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.\n\nBASE (basically available, soft state, eventually consistent)\n
  • #9: \n
  • #10: \n
  • #11: \n
  • #12: \n
  • #13: \n
  • #14: \n
  • #15: \n
  • #16: \n
  • #17: \n
  • #18: \n
  • #19: \n
  • #20: \n
  • #21: \n
  • #22: \n
  • #23: \n
  • #24: \n
  • #25: \n
  • #26: \n
  • #27: \n
  • #28: \n
  • #29: \n
  • #30: \n
  • #31: \n
  • #32: \n
  • #33: \n
  • #34: \n
  • #35: \n
  • #36: \n
  • #37: \n
  • #38: \n
  • #39: \n
  • #40: \n
  • #41: \n
  • #42: \n
  • #43: \n
  • #44: \n
  • #45: \n
  • #46: \n
  • #47: \n
  • #48: \n