SlideShare ist ein Scribd-Unternehmen logo
1 von 67
Downloaden Sie, um offline zu lesen
Cloud Foundry and MongoDB, a marriage
  made in heaven

  Patrick Chanezon
  @chanezon
  Senior Director, Developer Relations
  VMware




                                         © 2009 VMware Inc. All rights reserved

Friday, December 9, 11
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, Cloud


Friday, December 9, 11
Spring




                                  3


Friday, December 9, 11
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

Friday, December 9, 11
Spring Data




                                       5


Friday, December 9, 11
Data Access Challenge #1: Scale Horizontally




                                                 6


Friday, December 9, 11
Data Access Challenge #2: Heterogeneous data access needs




                                                              7


Friday, December 9, 11
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


Friday, December 9, 11
NoSQL offers several data store categories




Key-Value                Column       Document   Graph




      Redis,             Cassandra,    MongoDB   Neo4J
      Riak               HBase




                                                         9


Friday, December 9, 11
NoSQL offers several data store categories




Key-Value                Column   Document                        Graph




                                    MongoDB
                                    (who cares about the rest?)




                                                                      10


Friday, December 9, 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


Friday, December 9, 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


Friday, December 9, 11
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


Friday, December 9, 11
Spring MongoDB




                                          14


Friday, December 9, 11
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


Friday, December 9, 11
Simple Domain Class




                         16


Friday, December 9, 11
Mongo Template

  Direct Usage of the Mongo Template:




                                        17


Friday, December 9, 11
Mongo Template

  Direct Usage of the Mongo Template:




  Insert into “Person”
      Collection




                                        17


Friday, December 9, 11
Mongo Template

  Direct Usage of the Mongo Template:




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




                                                                         17


Friday, December 9, 11
Mongo Template

  Direct Usage of the Mongo Template:




                                  Dropped collection [database.person]




                                                                         17


Friday, December 9, 11
Generic Repository

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




                                                                              18


Friday, December 9, 11
Paging and Sorting Repository


    Paging and Sorting Repository:   Extends “CrudRepository”




                                                                19


Friday, December 9, 11
Paging and Sorting Repository


    Paging and Sorting Repository:   Extends “CrudRepository”




     Usage:




                                                                19


Friday, December 9, 11
Custom Repository

  Custom Repository:




                         20


Friday, December 9, 11
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


Friday, December 9, 11
Cross Store




                                       21


Friday, December 9, 11
JPA and MongoDB

      JPA “Customer” with a “SurveyInfo” Document




                                                    22


Friday, December 9, 11
Using a Cross-Store

       Saving a Customer with a SurveryInfo




                                              23


Friday, December 9, 11
Using a Cross-Store

       Saving a Customer with a SurveryInfo
                                 Create Customer




                                                   23


Friday, December 9, 11
Using a Cross-Store

       Saving a Customer with a SurveryInfo

                                          Create SurveyInfo




                                                              23


Friday, December 9, 11
Using a Cross-Store

       Saving a Customer with a SurveryInfo




           Assign Survey to Customer




                                              23


Friday, December 9, 11
Using a Cross-Store

       Saving a Customer with a SurveryInfo




                                        Save




                                               23


Friday, December 9, 11
Using a Cross-Store

       Saving a Customer with a SurveryInfo




                                        Save




       Mongo Document:




                                               23


Friday, December 9, 11
Cloud Foundry




                                         24


Friday, December 9, 11
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




   25


Friday, December 9, 11
Open Source



                                 26

Friday, December 9, 11
Open Source Advantage

   § http://code.google.com/p/googleappengine/issues/detail?id=13




   • https://github.com/cloudfoundry/vcap/pull/25




   27


Friday, December 9, 11
Multi Cloud



                                       28

Friday, December 9, 11
CloudFoundry.COM

                                      Cloud Foundry

              Runtimes & Frameworks

              Services

                                      vCenter / vSphere




              Infrastructure




                                                          29

Friday, December 9, 11
Cloud Foundry.ORG

                                          Cloud Foundry


                         The Source Code to Compile & Build Cloud Foundry



                                         vCenter / vSphere

               Download               Setup           Setup Scripts   Deploy Behind
                                   Environment                          Firewall
                  Code




                                                                                      30

Friday, December 9, 11
Micro Cloud Foundry




                         Micro




                                 31

Friday, December 9, 11
What is a Micro Cloud?




                                                 Or




                         Entire Cloud Running inside of a single VM


                                                                      32

Friday, December 9, 11
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


    33

Friday, December 9, 11
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


    33

Friday, December 9, 11
Pre-requisites

    Resources
                         Minimum 1 GB         Minimum 8 GB     Internet Connectivity



                         RAM                  Disk             (w/DHCP is ideal)


    Virtualization




     Clients


                 VMC                                         STS
                               Command line                                   GUI




    34

Friday, December 9, 11
What is in Micro Cloud Foundry?


                                                                            .COM




                             Dynamic Updating DNS


                         App Instances                           Services




                     Open source Platform as a Service project




                                                                 10.04



    35

Friday, December 9, 11
Other Cloud Foundry powered PaaS




    Private PaaS
    Added Python and Perl




    Public PaaS
    Added PHP




   36


Friday, December 9, 11
Services



                                    37

Friday, December 9, 11
Current Services Available on Cloud Foundry




                                                38

Friday, December 9, 11
Service Creation and Binding




                             App Instance




                                            39

Friday, December 9, 11
Service Creation and Binding




                             App Instance   Redis Service




                                                            39

Friday, December 9, 11
Service Creation and Binding




                             App Instance   Redis Service




                                                            39

Friday, December 9, 11
Service Creation and Binding




                                    App Instance   Redis Service




                         MongoDB
                          Service




                                                                   39

Friday, December 9, 11
Development
                    LifeCycle

                                 40

Friday, December 9, 11
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
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
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
How Apps are Accessed on Cloud Foundry

                         Request                      Web Interface
         Load
       Balancing
                                        Response
          and
        Routing




           Web

           App

   App Instance


                                   DB
                                                   “vmc push MyApp”
                              Service



Friday, December 9, 11
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”
                               Service



Friday, December 9, 11
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
At Scale – Multi-Node Distributed App



                                            system load balancer




                          elastic pool

                  redis                                                  mysql
                                front_end                   front_end




                                                 rabbitMQ




                          elastic pool

                                                                        mongodb
                                              back_end




                                                                                  46 10


Friday, December 9, 11
Setting up Cloud Foundry Demo




                                                     47


Friday, December 9, 11
Caldecott: tunnelling to Cloud Foundry services




                                                    48


Friday, December 9, 11
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());
  }


                                                                   49


Friday, December 9, 11
Accessing Services Bound to Cloud Foundry (consumption)


  @Inject private Mongo mongo ;

  @Inject private MongoTemplate mongoTemplate;




                                                            50


Friday, December 9, 11
Cloud Foundry MongoDB Demo




                                                  51


Friday, December 9, 11
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




                                                                52


Friday, December 9, 11

Weitere ähnliche Inhalte

Was ist angesagt?

Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, SparkBuilding Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Todd Fritz
 
OpenNebulaConf2015 1.03 Private, Public, Hybrid: The Real Economics of Open S...
OpenNebulaConf2015 1.03 Private, Public, Hybrid: The Real Economics of Open S...OpenNebulaConf2015 1.03 Private, Public, Hybrid: The Real Economics of Open S...
OpenNebulaConf2015 1.03 Private, Public, Hybrid: The Real Economics of Open S...
OpenNebula Project
 
DRILETT_AWS_VPC_Presentation_2MB
DRILETT_AWS_VPC_Presentation_2MBDRILETT_AWS_VPC_Presentation_2MB
DRILETT_AWS_VPC_Presentation_2MB
David Rilett
 
Software architectures for the cloud
Software architectures for the cloudSoftware architectures for the cloud
Software architectures for the cloud
Georgios Gousios
 

Was ist angesagt? (20)

Netflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsNetflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and Ops
 
Performance architecture for cloud connect
Performance architecture for cloud connectPerformance architecture for cloud connect
Performance architecture for cloud connect
 
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, SparkBuilding Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
Building Reactive Fast Data & the Data Lake with Akka, Kafka, Spark
 
Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...
Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...
Billions of Messages in Real Time: Why Paypal & LinkedIn Trust an Engagement ...
 
Cloud Architecture best practices
Cloud Architecture best practicesCloud Architecture best practices
Cloud Architecture best practices
 
OpenNebulaConf2015 1.03 Private, Public, Hybrid: The Real Economics of Open S...
OpenNebulaConf2015 1.03 Private, Public, Hybrid: The Real Economics of Open S...OpenNebulaConf2015 1.03 Private, Public, Hybrid: The Real Economics of Open S...
OpenNebulaConf2015 1.03 Private, Public, Hybrid: The Real Economics of Open S...
 
Strimzi - Where Apache Kafka meets OpenShift - OpenShift Spain MeetUp
Strimzi - Where Apache Kafka meets OpenShift - OpenShift Spain MeetUpStrimzi - Where Apache Kafka meets OpenShift - OpenShift Spain MeetUp
Strimzi - Where Apache Kafka meets OpenShift - OpenShift Spain MeetUp
 
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
 
MongoDB World 2016: NOW TV and Linear Streaming: Scaling MongoDB for High Loa...
MongoDB World 2016: NOW TV and Linear Streaming: Scaling MongoDB for High Loa...MongoDB World 2016: NOW TV and Linear Streaming: Scaling MongoDB for High Loa...
MongoDB World 2016: NOW TV and Linear Streaming: Scaling MongoDB for High Loa...
 
Extending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesExtending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with Kubernetes
 
Event Sourcing, Stream Processing and Serverless (Benjamin Stopford, Confluen...
Event Sourcing, Stream Processing and Serverless (Benjamin Stopford, Confluen...Event Sourcing, Stream Processing and Serverless (Benjamin Stopford, Confluen...
Event Sourcing, Stream Processing and Serverless (Benjamin Stopford, Confluen...
 
IoT and Event Streaming at Scale with Apache Kafka
IoT and Event Streaming at Scale with Apache KafkaIoT and Event Streaming at Scale with Apache Kafka
IoT and Event Streaming at Scale with Apache Kafka
 
[db tech showcase Tokyo 2017] C24:Taking off to the clouds. How to use DMS in...
[db tech showcase Tokyo 2017] C24:Taking off to the clouds. How to use DMS in...[db tech showcase Tokyo 2017] C24:Taking off to the clouds. How to use DMS in...
[db tech showcase Tokyo 2017] C24:Taking off to the clouds. How to use DMS in...
 
Kafka summit apac session
Kafka summit apac sessionKafka summit apac session
Kafka summit apac session
 
Cloud Architecture Tutorial - Platform Component Architecture (2of3)
Cloud Architecture Tutorial - Platform Component Architecture (2of3)Cloud Architecture Tutorial - Platform Component Architecture (2of3)
Cloud Architecture Tutorial - Platform Component Architecture (2of3)
 
DRILETT_AWS_VPC_Presentation_2MB
DRILETT_AWS_VPC_Presentation_2MBDRILETT_AWS_VPC_Presentation_2MB
DRILETT_AWS_VPC_Presentation_2MB
 
Scaling Pinterest
Scaling PinterestScaling Pinterest
Scaling Pinterest
 
Real-time Streaming Pipelines with FLaNK
Real-time Streaming Pipelines with FLaNKReal-time Streaming Pipelines with FLaNK
Real-time Streaming Pipelines with FLaNK
 
Software architectures for the cloud
Software architectures for the cloudSoftware architectures for the cloud
Software architectures for the cloud
 
Embracing Database Diversity with Kafka and Debezium
Embracing Database Diversity with Kafka and DebeziumEmbracing Database Diversity with Kafka and Debezium
Embracing Database Diversity with Kafka and Debezium
 

Ähnlich wie CloudFoundry and MongoDb, a marriage made in heaven

Spring Data NHJUG April 2012
Spring Data NHJUG April 2012Spring Data NHJUG April 2012
Spring Data NHJUG April 2012
trisberg
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.js
Richard Rodger
 
Proud to be polyglot!
Proud to be polyglot!Proud to be polyglot!
Proud to be polyglot!
NLJUG
 
The spring 32 update final
The spring 32 update finalThe spring 32 update final
The spring 32 update final
Joshua Long
 
AFCEA C4I Symposium: The 4th C in C4I Stands for Cloud:Factors Driving Adopti...
AFCEA C4I Symposium: The 4th C in C4I Stands for Cloud:Factors Driving Adopti...AFCEA C4I Symposium: The 4th C in C4I Stands for Cloud:Factors Driving Adopti...
AFCEA C4I Symposium: The 4th C in C4I Stands for Cloud:Factors Driving Adopti...
Patrick Chanezon
 

Ähnlich wie CloudFoundry and MongoDb, a marriage made in heaven (20)

using Spring and MongoDB on Cloud Foundry
using Spring and MongoDB on Cloud Foundryusing Spring and MongoDB on Cloud Foundry
using Spring and MongoDB on Cloud Foundry
 
Spring Data NHJUG April 2012
Spring Data NHJUG April 2012Spring Data NHJUG April 2012
Spring Data NHJUG April 2012
 
Thomas risberg mongosv-2012-spring-data-cloud-foundry
Thomas risberg mongosv-2012-spring-data-cloud-foundryThomas risberg mongosv-2012-spring-data-cloud-foundry
Thomas risberg mongosv-2012-spring-data-cloud-foundry
 
Drupal and the rise of the documents
Drupal and the rise of the documentsDrupal and the rise of the documents
Drupal and the rise of the documents
 
Prepare Your Data For The Cloud
Prepare Your Data For The CloudPrepare Your Data For The Cloud
Prepare Your Data For The Cloud
 
Preparing your data for the cloud
Preparing your data for the cloudPreparing your data for the cloud
Preparing your data for the cloud
 
Preparing yourdataforcloud
Preparing yourdataforcloudPreparing yourdataforcloud
Preparing yourdataforcloud
 
Everyday - mongodb
Everyday - mongodbEveryday - mongodb
Everyday - mongodb
 
Big Data Israel Meetup : Couchbase and Big Data
Big Data Israel Meetup : Couchbase and Big DataBig Data Israel Meetup : Couchbase and Big Data
Big Data Israel Meetup : Couchbase and Big Data
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.js
 
Proud to be polyglot!
Proud to be polyglot!Proud to be polyglot!
Proud to be polyglot!
 
Extending Spring for Custom Usage
Extending Spring for Custom UsageExtending Spring for Custom Usage
Extending Spring for Custom Usage
 
HTML5 and Sencha Touch
HTML5 and Sencha TouchHTML5 and Sencha Touch
HTML5 and Sencha Touch
 
Building A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage SolutionBuilding A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage Solution
 
Introduction to NoSQL with Couchbase
Introduction to NoSQL with CouchbaseIntroduction to NoSQL with Couchbase
Introduction to NoSQL with Couchbase
 
Morning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et IntroductionsMorning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et Introductions
 
The spring 32 update final
The spring 32 update finalThe spring 32 update final
The spring 32 update final
 
AFCEA C4I Symposium: The 4th C in C4I Stands for Cloud:Factors Driving Adopti...
AFCEA C4I Symposium: The 4th C in C4I Stands for Cloud:Factors Driving Adopti...AFCEA C4I Symposium: The 4th C in C4I Stands for Cloud:Factors Driving Adopti...
AFCEA C4I Symposium: The 4th C in C4I Stands for Cloud:Factors Driving Adopti...
 
Hyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and JavascriptHyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and Javascript
 
Navigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skiesNavigating NoSQL in cloudy skies
Navigating NoSQL in cloudy skies
 

Mehr von Patrick Chanezon

Mehr von Patrick Chanezon (20)

KubeCon 2019 - Scaling your cluster (both ways)
KubeCon 2019 - Scaling your cluster (both ways)KubeCon 2019 - Scaling your cluster (both ways)
KubeCon 2019 - Scaling your cluster (both ways)
 
KubeCon China 2019 - Building Apps with Containers, Functions and Managed Ser...
KubeCon China 2019 - Building Apps with Containers, Functions and Managed Ser...KubeCon China 2019 - Building Apps with Containers, Functions and Managed Ser...
KubeCon China 2019 - Building Apps with Containers, Functions and Managed Ser...
 
Dockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud ServicesDockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud Services
 
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud ServicesGIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
 
Docker Enterprise Workshop - Intro
Docker Enterprise Workshop - IntroDocker Enterprise Workshop - Intro
Docker Enterprise Workshop - Intro
 
Docker Enterprise Workshop - Technical
Docker Enterprise Workshop - TechnicalDocker Enterprise Workshop - Technical
Docker Enterprise Workshop - Technical
 
The Tao of Docker - ITES 2018
The Tao of Docker - ITES 2018The Tao of Docker - ITES 2018
The Tao of Docker - ITES 2018
 
Moby KubeCon 2017
Moby KubeCon 2017Moby KubeCon 2017
Moby KubeCon 2017
 
Microsoft Techsummit Zurich Docker and Microsoft
Microsoft Techsummit Zurich Docker and MicrosoftMicrosoft Techsummit Zurich Docker and Microsoft
Microsoft Techsummit Zurich Docker and Microsoft
 
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Develop and deploy Kubernetes  applications with Docker - IBM Index 2018Develop and deploy Kubernetes  applications with Docker - IBM Index 2018
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
 
Docker Meetup Feb 2018 Develop and deploy Kubernetes Apps with Docker
Docker Meetup Feb 2018 Develop and deploy Kubernetes Apps with DockerDocker Meetup Feb 2018 Develop and deploy Kubernetes Apps with Docker
Docker Meetup Feb 2018 Develop and deploy Kubernetes Apps with Docker
 
DockerCon EU 2017 Recap
DockerCon EU 2017 RecapDockerCon EU 2017 Recap
DockerCon EU 2017 Recap
 
Docker Innovation Culture
Docker Innovation CultureDocker Innovation Culture
Docker Innovation Culture
 
The Tao of Docker - Devfest Nantes 2017
The Tao of Docker - Devfest Nantes 2017The Tao of Docker - Devfest Nantes 2017
The Tao of Docker - Devfest Nantes 2017
 
Docker 之道 Modernize Traditional Applications with 无为 Create New Cloud Native ...
Docker 之道 Modernize Traditional Applications with 无为 Create New Cloud Native ...Docker 之道 Modernize Traditional Applications with 无为 Create New Cloud Native ...
Docker 之道 Modernize Traditional Applications with 无为 Create New Cloud Native ...
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017
 
Moby Introduction - June 2017
Moby Introduction - June 2017Moby Introduction - June 2017
Moby Introduction - June 2017
 
Docker Cap Gemini CloudXperience 2017 - la revolution des conteneurs logiciels
Docker Cap Gemini CloudXperience 2017 - la revolution des conteneurs logicielsDocker Cap Gemini CloudXperience 2017 - la revolution des conteneurs logiciels
Docker Cap Gemini CloudXperience 2017 - la revolution des conteneurs logiciels
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
 
Oscon 2017: Build your own container-based system with the Moby project
Oscon 2017: Build your own container-based system with the Moby projectOscon 2017: Build your own container-based system with the Moby project
Oscon 2017: Build your own container-based system with the Moby project
 

Kürzlich hochgeladen

+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@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
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...
 
+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
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
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
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
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...
 

CloudFoundry and MongoDb, a marriage made in heaven

  • 1. Cloud Foundry and MongoDB, a marriage made in heaven Patrick Chanezon @chanezon Senior Director, Developer Relations VMware © 2009 VMware Inc. All rights reserved Friday, 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, Cloud Friday, December 9, 11
  • 3. Spring 3 Friday, 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!) 4 Friday, December 9, 11
  • 5. Spring Data 5 Friday, December 9, 11
  • 6. Data Access Challenge #1: Scale Horizontally 6 Friday, December 9, 11
  • 7. Data Access Challenge #2: Heterogeneous data access needs 7 Friday, 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 8 Friday, December 9, 11
  • 9. NoSQL offers several data store categories Key-Value Column Document Graph Redis, Cassandra, MongoDB Neo4J Riak HBase 9 Friday, December 9, 11
  • 10. NoSQL offers several data store categories Key-Value Column Document Graph MongoDB (who cares about the rest?) 10 Friday, 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) 11 Friday, 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 12 Friday, 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 13 Friday, December 9, 11
  • 14. Spring MongoDB 14 Friday, 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 15 Friday, December 9, 11
  • 16. Simple Domain Class 16 Friday, December 9, 11
  • 17. Mongo Template Direct Usage of the Mongo Template: 17 Friday, December 9, 11
  • 18. Mongo Template Direct Usage of the Mongo Template: Insert into “Person” Collection 17 Friday, December 9, 11
  • 19. Mongo Template Direct Usage of the Mongo Template: findOne using query: { "name" : "Joe"} in db.collection: database.Person 17 Friday, December 9, 11
  • 20. Mongo Template Direct Usage of the Mongo Template: Dropped collection [database.person] 17 Friday, December 9, 11
  • 21. Generic Repository Interface for generic CRUD operations on a repository for a specific type 18 Friday, December 9, 11
  • 22. Paging and Sorting Repository Paging and Sorting Repository: Extends “CrudRepository” 19 Friday, December 9, 11
  • 23. Paging and Sorting Repository Paging and Sorting Repository: Extends “CrudRepository” Usage: 19 Friday, December 9, 11
  • 24. Custom Repository Custom Repository: 20 Friday, 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) 20 Friday, December 9, 11
  • 26. Cross Store 21 Friday, December 9, 11
  • 27. JPA and MongoDB JPA “Customer” with a “SurveyInfo” Document 22 Friday, December 9, 11
  • 28. Using a Cross-Store Saving a Customer with a SurveryInfo 23 Friday, December 9, 11
  • 29. Using a Cross-Store Saving a Customer with a SurveryInfo Create Customer 23 Friday, December 9, 11
  • 30. Using a Cross-Store Saving a Customer with a SurveryInfo Create SurveyInfo 23 Friday, December 9, 11
  • 31. Using a Cross-Store Saving a Customer with a SurveryInfo Assign Survey to Customer 23 Friday, December 9, 11
  • 32. Using a Cross-Store Saving a Customer with a SurveryInfo Save 23 Friday, December 9, 11
  • 33. Using a Cross-Store Saving a Customer with a SurveryInfo Save Mongo Document: 23 Friday, December 9, 11
  • 34. Cloud Foundry 24 Friday, 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 25 Friday, December 9, 11
  • 36. Open Source 26 Friday, December 9, 11
  • 37. Open Source Advantage § http://code.google.com/p/googleappengine/issues/detail?id=13 • https://github.com/cloudfoundry/vcap/pull/25 27 Friday, December 9, 11
  • 38. Multi Cloud 28 Friday, December 9, 11
  • 39. CloudFoundry.COM Cloud Foundry Runtimes & Frameworks Services vCenter / vSphere Infrastructure 29 Friday, 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 30 Friday, December 9, 11
  • 41. Micro Cloud Foundry Micro 31 Friday, December 9, 11
  • 42. What is a Micro Cloud? Or Entire Cloud Running inside of a single VM 32 Friday, 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 33 Friday, 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 33 Friday, 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 34 Friday, 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 35 Friday, December 9, 11
  • 47. Other Cloud Foundry powered PaaS Private PaaS Added Python and Perl Public PaaS Added PHP 36 Friday, December 9, 11
  • 48. Services 37 Friday, December 9, 11
  • 49. Current Services Available on Cloud Foundry 38 Friday, December 9, 11
  • 50. Service Creation and Binding App Instance 39 Friday, December 9, 11
  • 51. Service Creation and Binding App Instance Redis Service 39 Friday, December 9, 11
  • 52. Service Creation and Binding App Instance Redis Service 39 Friday, December 9, 11
  • 53. Service Creation and Binding App Instance Redis Service MongoDB Service 39 Friday, December 9, 11
  • 54. Development LifeCycle 40 Friday, 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” Service Friday, 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” Service Friday, 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 10 Friday, December 9, 11
  • 62. Setting up Cloud Foundry Demo 47 Friday, December 9, 11
  • 63. Caldecott: tunnelling to Cloud Foundry services 48 Friday, 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()); } 49 Friday, December 9, 11
  • 65. Accessing Services Bound to Cloud Foundry (consumption) @Inject private Mongo mongo ; @Inject private MongoTemplate mongoTemplate; 50 Friday, December 9, 11
  • 66. Cloud Foundry MongoDB Demo 51 Friday, 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 52 Friday, December 9, 11