Your SlideShare is downloading. ×
0
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

CloudFoundry and MongoDb, a marriage made in heaven

4,168

Published on

This talk will provide an overview of the PaaS (Platform as a Service) landscape, and will describe the Cloud Foundry open source PaaS, with its multi-framework, multi-service, multi-cloud model. …

This talk will provide an overview of the PaaS (Platform as a Service) landscape, and will describe the Cloud Foundry open source PaaS, with its multi-framework, multi-service, multi-cloud model. Cloud Foundry allows developers to provision apps in Java/Spring, Ruby/Rails, Ruby/Sinatra, Javascript/Node, and leverage services like MySQL, MongoDB, Reddis, Postgres and RabbitMQ. It can be used as a public PaaS on CloudFoundry.com and other service providers (ActiveState, AppFog), to create your own private cloud, or on your laptop using the Micro Cloud Foundry VM. Micro Cloud Foundry is a very easy way for developers to start working on their application using their framework of choice and MongoDB, without the need to setup a development environment, and your app is one command line away (vmc push) from deployment to cloudfoundry.com.

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

No Downloads
Views
Total Views
4,168
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
56
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Cloud Foundry and MongoDB, a marriage made in heaven Patrick Chanezon @chanezon Senior Director, Developer Relations VMware © 2009 VMware Inc. All rights reservedFriday, December 9, 11
  • 2. P@ in a nutshell • French, based in San Francisco • Senior Director, Developer Relations,VMware • Software Plumber, API guy, mix of Enterprise and Consumer • 18 years writing software, backend guy with a taste for javascript • 2 y Accenture (Notes guru), 3 y Netscape/AOL (Servers, Portals), 5 y Sun (ecommerce, blogs, Portals, feeds, open source) • 6 years at Google, API guy (first hired, helped start the team) • Adwords, Checkout, Social, HTML5, CloudFriday, December 9, 11
  • 3. Spring 3Friday, December 9, 11
  • 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!) 4Friday, December 9, 11
  • 5. Spring Data 5Friday, December 9, 11
  • 6. Data Access Challenge #1: Scale Horizontally 6Friday, December 9, 11
  • 7. Data Access Challenge #2: Heterogeneous data access needs 7Friday, December 9, 11
  • 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 8Friday, December 9, 11
  • 9. NoSQL offers several data store categoriesKey-Value Column Document Graph Redis, Cassandra, MongoDB Neo4J Riak HBase 9Friday, December 9, 11
  • 10. NoSQL offers several data store categoriesKey-Value Column Document Graph MongoDB (who cares about the rest?) 10Friday, December 9, 11
  • 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) 11Friday, December 9, 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 12Friday, December 9, 11
  • 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 13Friday, December 9, 11
  • 14. Spring MongoDB 14Friday, December 9, 11
  • 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 15Friday, December 9, 11
  • 16. Simple Domain Class 16Friday, December 9, 11
  • 17. Mongo Template Direct Usage of the Mongo Template: 17Friday, December 9, 11
  • 18. Mongo Template Direct Usage of the Mongo Template: Insert into “Person” Collection 17Friday, December 9, 11
  • 19. Mongo Template Direct Usage of the Mongo Template: findOne using query: { "name" : "Joe"} in db.collection: database.Person 17Friday, December 9, 11
  • 20. Mongo Template Direct Usage of the Mongo Template: Dropped collection [database.person] 17Friday, December 9, 11
  • 21. Generic Repository Interface for generic CRUD operations on a repository for a specific type 18Friday, December 9, 11
  • 22. Paging and Sorting Repository Paging and Sorting Repository: Extends “CrudRepository” 19Friday, December 9, 11
  • 23. Paging and Sorting Repository Paging and Sorting Repository: Extends “CrudRepository” Usage: 19Friday, December 9, 11
  • 24. Custom Repository Custom Repository: 20Friday, December 9, 11
  • 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) 20Friday, December 9, 11
  • 26. Cross Store 21Friday, December 9, 11
  • 27. JPA and MongoDB JPA “Customer” with a “SurveyInfo” Document 22Friday, December 9, 11
  • 28. Using a Cross-Store Saving a Customer with a SurveryInfo 23Friday, December 9, 11
  • 29. Using a Cross-Store Saving a Customer with a SurveryInfo Create Customer 23Friday, December 9, 11
  • 30. Using a Cross-Store Saving a Customer with a SurveryInfo Create SurveyInfo 23Friday, December 9, 11
  • 31. Using a Cross-Store Saving a Customer with a SurveryInfo Assign Survey to Customer 23Friday, December 9, 11
  • 32. Using a Cross-Store Saving a Customer with a SurveryInfo Save 23Friday, December 9, 11
  • 33. Using a Cross-Store Saving a Customer with a SurveryInfo Save Mongo Document: 23Friday, December 9, 11
  • 34. Cloud Foundry 24Friday, December 9, 11
  • 35. Cloud Foundry: The Open PaaS • Open Source: Apache 2 Licensed • multi language/frameworks • multi services • multi cloud Ap ce pli vFabric rfa Postgres Private ca nte Data Services tio Clouds rI n e Se Public vid vFabric RabbitMQTM rvi Cloud ro Msg Services ce dP Micro ou Other Cloud Cl Services 25Friday, December 9, 11
  • 36. Open Source 26Friday, December 9, 11
  • 37. Open Source Advantage § http://code.google.com/p/googleappengine/issues/detail?id=13 • https://github.com/cloudfoundry/vcap/pull/25 27Friday, December 9, 11
  • 38. Multi Cloud 28Friday, December 9, 11
  • 39. CloudFoundry.COM Cloud Foundry Runtimes & Frameworks Services vCenter / vSphere Infrastructure 29Friday, December 9, 11
  • 40. Cloud Foundry.ORG Cloud Foundry The Source Code to Compile & Build Cloud Foundry vCenter / vSphere Download Setup Setup Scripts Deploy Behind Environment Firewall Code 30Friday, December 9, 11
  • 41. Micro Cloud Foundry Micro 31Friday, December 9, 11
  • 42. What is a Micro Cloud? Or Entire Cloud Running inside of a single VM 32Friday, December 9, 11
  • 43. Micro Cloud Foundry… (BETA) A pre-built Micro (Single VM) version of Cloud Foundry… You need a Cloud Foundry.com Account to use Micro Cloud Foundry Signup @ http://cloudfoundry.com/micro 33Friday, December 9, 11
  • 44. Micro Cloud Foundry… (BETA) A pre-built Micro (Single VM) version of Cloud Foundry… Micro You need a Cloud Foundry.com Account to use Micro Cloud Foundry Signup @ http://cloudfoundry.com/micro 33Friday, December 9, 11
  • 45. Pre-requisites Resources Minimum 1 GB Minimum 8 GB Internet Connectivity RAM Disk (w/DHCP is ideal) Virtualization Clients VMC STS Command line GUI 34Friday, December 9, 11
  • 46. What is in Micro Cloud Foundry? .COM Dynamic Updating DNS App Instances Services Open source Platform as a Service project 10.04 35Friday, December 9, 11
  • 47. Other Cloud Foundry powered PaaS Private PaaS Added Python and Perl Public PaaS Added PHP 36Friday, December 9, 11
  • 48. Services 37Friday, December 9, 11
  • 49. Current Services Available on Cloud Foundry 38Friday, December 9, 11
  • 50. Service Creation and Binding App Instance 39Friday, December 9, 11
  • 51. Service Creation and Binding App Instance Redis Service 39Friday, December 9, 11
  • 52. Service Creation and Binding App Instance Redis Service 39Friday, December 9, 11
  • 53. Service Creation and Binding App Instance Redis Service MongoDB Service 39Friday, December 9, 11
  • 54. Development LifeCycle 40Friday, December 9, 11
  • 55. Traditional App Deploy and Request/Response Web Request/Allocate Web Build/Setup Install/Configure App Deploy/Test App Scale? Upgrade? DB DB Update?Friday, December 9, 11
  • 56. How Apps are Deployed on Cloud Foundry Web Web App “vmc push MyApp” DB App Web Scale? “vmc instances MyApp 5” DB Upgrade? “vmc map MyApp MyApp2” Update? “vmc update MyApp”Friday, December 9, 11
  • 57. How Apps are Deployed on Cloud Foundry Web Web App “vmc push MyApp” DB App Web Scale? “vmc instances MyApp 5” DB Upgrade? “vmc map MyApp MyApp2” Update? “vmc update MyApp”Friday, December 9, 11
  • 58. How Apps are Accessed on Cloud Foundry Request Web Interface Load Balancing Response and Routing Web App App Instance DB “vmc push MyApp” ServiceFriday, December 9, 11
  • 59. How Apps are Scaled on Cloud Foundry Request Load Load Load Balancer(s) Balancing Response Balancer(s) and Routing App Instances Web Web Web App App App DB “vmc instances MyApp 3” ServiceFriday, December 9, 11
  • 60. How Apps are Updated on Cloud Foundry Previous Instance Updated New Version Stopped Code Version Web Web Web Web App App App App DB DB Service Service “vmc update MyApp”Friday, December 9, 11
  • 61. At Scale – Multi-Node Distributed App system load balancer elastic pool redis mysql front_end front_end rabbitMQ elastic pool mongodb back_end 46 10Friday, December 9, 11
  • 62. Setting up Cloud Foundry Demo 47Friday, December 9, 11
  • 63. Caldecott: tunnelling to Cloud Foundry services 48Friday, December 9, 11
  • 64. 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()); } 49Friday, December 9, 11
  • 65. Accessing Services Bound to Cloud Foundry (consumption) @Inject private Mongo mongo ; @Inject private MongoTemplate mongoTemplate; 50Friday, December 9, 11
  • 66. Cloud Foundry MongoDB Demo 51Friday, December 9, 11
  • 67. 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 52Friday, December 9, 11

×