SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Hands-on NoSQL  MongoDB & Spring Integration http://automateddeveloper.blogspot.com
[object Object]
Neither I, nor this presentation, are in any way affiliated with SpringSource or MongoDB
Still want more?http://automateddeveloper.blogspot.com http://www.thirdmindmedia.co.uk info@thirdmindmedia.co.uk
What is NoSQL? ,[object Object]
The NoSQL umbrella covers a range of non-relational databases, including key-value, document , wide column store and graph based databases,[object Object]
Many leading web 2.0 sites now use NoSQL implementations:Facebook – Cassandra (originally developed in-house and later open-sourced Twitter – Hadoop & Cassandra Google – BigTable Digg – Cassandra FourSquare - MongoDB
In the News 4,850% Percent increase in NoSQL jobs since November 2009 as reported by SimplyHired.com $14million Amount raised in Series C Funding last week by CouchBase  for further investment in to NoSQL solutions(Aug2011) 8TB Amount of data generated everyday in Twitter, and needs to be supported by their NoSQL solution (figure from 2010)
MongoDB ,[object Object]
Dynamic schemas, storing data in JSON style documents that allows for addition of data on the fly
Supports indexing of documents
Auto-sharding supported, providing full horizontal scaling,[object Object]
As more and more web sites need to be able to handle huge amounts of data, there will be an increased need to be able to build professional sites incorporating NoSQL solutions,[object Object]
Getting Started ,[object Object]
Only the configuration to connect an existing Spring MVC app will be covered in detail
Before proceeding, install MongoDB – full details are available: http://www.mongodb.org/display/DOCS/Quickstart
If you plan to follow the walkthrough with the source code, it is provided as an Eclipse/Maven project and uses the M2Eclipse plugin,[object Object]
Using Spring Data we can model ourdomain using POJOsand annotations.,[object Object]
@Id on any member variable to be used as an identifier for the object (must be String/int/long)
The @Id field must either be named “id”, or the annotation used in combination with a MappingConverter,[object Object]
In our Resume example, only our top level “Resume” object needs to be annotated and we will only be persisting/retrieving at this level (Document based DB makes sense for this model, as a “ResumePage” only makes sense within the context of a “Resume” and not as an object in itself)

Weitere ähnliche Inhalte

Andere mochten auch

Aplikom_Unsri_1. MyBiodata dan keunikan Matematika_Sutri Octaviana
Aplikom_Unsri_1. MyBiodata dan keunikan Matematika_Sutri OctavianaAplikom_Unsri_1. MyBiodata dan keunikan Matematika_Sutri Octaviana
Aplikom_Unsri_1. MyBiodata dan keunikan Matematika_Sutri Octaviana
sutrioctavianasitorus
 
Aspire one series service guide
Aspire one series service guideAspire one series service guide
Aspire one series service guide
Setyo Prasadja
 
The quality of work and health inequalities – cross-national differences
The quality of work and health inequalities –  cross-national differences �The quality of work and health inequalities –  cross-national differences �
The quality of work and health inequalities – cross-national differences
sophieproject
 
Book4 unit1-lesson5
Book4 unit1-lesson5Book4 unit1-lesson5
Book4 unit1-lesson5
stthomas8
 
2012 06 FGV Custo Mão de Obra Encargos Sociai Brasil
2012 06   FGV Custo Mão de Obra Encargos Sociai Brasil2012 06   FGV Custo Mão de Obra Encargos Sociai Brasil
2012 06 FGV Custo Mão de Obra Encargos Sociai Brasil
Siamfesp Sindicato
 
Microorganisms
MicroorganismsMicroorganisms
Microorganisms
sunilbhil
 

Andere mochten auch (17)

Cassandra By Example: Data Modelling with CQL3
Cassandra By Example: Data Modelling with CQL3Cassandra By Example: Data Modelling with CQL3
Cassandra By Example: Data Modelling with CQL3
 
Aplikom_Unsri_1. MyBiodata dan keunikan Matematika_Sutri Octaviana
Aplikom_Unsri_1. MyBiodata dan keunikan Matematika_Sutri OctavianaAplikom_Unsri_1. MyBiodata dan keunikan Matematika_Sutri Octaviana
Aplikom_Unsri_1. MyBiodata dan keunikan Matematika_Sutri Octaviana
 
Lulusan SMK PI class of 2014
Lulusan SMK PI class of 2014Lulusan SMK PI class of 2014
Lulusan SMK PI class of 2014
 
Aspire one series service guide
Aspire one series service guideAspire one series service guide
Aspire one series service guide
 
Que es google docs
Que es google docsQue es google docs
Que es google docs
 
Poor Pigs
Poor PigsPoor Pigs
Poor Pigs
 
Chafer, 52 Bible Doctines: Man and sin part 2
Chafer, 52 Bible Doctines: Man and sin part 2Chafer, 52 Bible Doctines: Man and sin part 2
Chafer, 52 Bible Doctines: Man and sin part 2
 
The quality of work and health inequalities – cross-national differences
The quality of work and health inequalities –  cross-national differences �The quality of work and health inequalities –  cross-national differences �
The quality of work and health inequalities – cross-national differences
 
Yg Ini 1
Yg Ini 1Yg Ini 1
Yg Ini 1
 
工作狂日记
工作狂日记工作狂日记
工作狂日记
 
Synapseindia android apps (operating system)
Synapseindia android apps (operating system)Synapseindia android apps (operating system)
Synapseindia android apps (operating system)
 
Visual Network Analysis
Visual Network AnalysisVisual Network Analysis
Visual Network Analysis
 
Book4 unit1-lesson5
Book4 unit1-lesson5Book4 unit1-lesson5
Book4 unit1-lesson5
 
2012 06 FGV Custo Mão de Obra Encargos Sociai Brasil
2012 06   FGV Custo Mão de Obra Encargos Sociai Brasil2012 06   FGV Custo Mão de Obra Encargos Sociai Brasil
2012 06 FGV Custo Mão de Obra Encargos Sociai Brasil
 
Ususnmptn2011
Ususnmptn2011Ususnmptn2011
Ususnmptn2011
 
Say little, do more.
Say little, do more.Say little, do more.
Say little, do more.
 
Microorganisms
MicroorganismsMicroorganisms
Microorganisms
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

MongoDB & Spring MVC Integration

  • 1. Hands-on NoSQL MongoDB & Spring Integration http://automateddeveloper.blogspot.com
  • 2.
  • 3. Neither I, nor this presentation, are in any way affiliated with SpringSource or MongoDB
  • 4. Still want more?http://automateddeveloper.blogspot.com http://www.thirdmindmedia.co.uk info@thirdmindmedia.co.uk
  • 5.
  • 6.
  • 7. Many leading web 2.0 sites now use NoSQL implementations:Facebook – Cassandra (originally developed in-house and later open-sourced Twitter – Hadoop & Cassandra Google – BigTable Digg – Cassandra FourSquare - MongoDB
  • 8. In the News 4,850% Percent increase in NoSQL jobs since November 2009 as reported by SimplyHired.com $14million Amount raised in Series C Funding last week by CouchBase for further investment in to NoSQL solutions(Aug2011) 8TB Amount of data generated everyday in Twitter, and needs to be supported by their NoSQL solution (figure from 2010)
  • 9.
  • 10. Dynamic schemas, storing data in JSON style documents that allows for addition of data on the fly
  • 12.
  • 13.
  • 14.
  • 15. Only the configuration to connect an existing Spring MVC app will be covered in detail
  • 16. Before proceeding, install MongoDB – full details are available: http://www.mongodb.org/display/DOCS/Quickstart
  • 17.
  • 18.
  • 19. @Id on any member variable to be used as an identifier for the object (must be String/int/long)
  • 20.
  • 21. In our Resume example, only our top level “Resume” object needs to be annotated and we will only be persisting/retrieving at this level (Document based DB makes sense for this model, as a “ResumePage” only makes sense within the context of a “Resume” and not as an object in itself)
  • 22. Using JPA, all three objects would be annotated “@Entity” and all could be queried as independent objects@Document public class Resume@Idprivate String id; public class ResumePage public class PageSection
  • 23.
  • 24.
  • 25.
  • 26. There is no real change in the Service or Controller Layers to the normal Spring MVC approach
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. NoSQL should be considered as another tool in the arsenal – RDBMS is not going anywhere!
  • 33.
  • 34. Feel free to drop me an email or come by to the blog and leave a comment if you have any questions or feedback