SlideShare a Scribd company logo
1 of 56
Download to read offline
Migrating to Cloud Foundry
Peter Ledbrook - VMware
t: @pledbrook
e: pledbrook@vmware.com




© 2012 VMware, Inc. All rights reserved.
What’s happening with applications today?
Frameworks are what really matter
  •  Developer productivity and innovation
  •  Reduce time to market


New application types
  •  Mobile, Social, SaaS
  •  Apps released early and often


Data intensive
  •  Emerging requirements: elasticity, multi-cloud
  •  Web orientation drives exponential data volumes

Deployed on virtual and cloud infrastructures
  •  Virtualization, Cloud, PaaS


                                                       2
The promise of PaaS

           App 1             App 2          App 3




                            Platform
        Servlet Container   Database     Other services


                        Infrastructure
                CPU          Memory        OS


      • Zero config
      • Automatic provisioning

                                                          3
The Open
        Platform as a Service

 Deploy and scale applications in
seconds, without locking yourself
        into a single cloud

                                 Open,
                            ple,     ble
                       Sim , Scala
                       lexible
                      F
Choice of frameworks, services & clouds
                                      OSS community
               ne!
             lo
          da
        an
      St
  +




                                                  5
Choice of frameworks, services & clouds
                                                                   OSS community
                e!
              on
            al
        a nd
      St
  +


  vFabric
  Postgres
                                    Ap
                                       p
                     Data
                                           lica
                     Services
                                            'o
                                              n *S

           vFabric
                                                  erv


           RabbitMQTM           Msg
                                                     ice


                                Services
                                                        *In
                                                        ter
                                                           fac
                                                              e*



                                              Other
                                             Services

                     Additional partners
                     services …




                                                                               6
Choice of frameworks, services & clouds
                                                                                               OSS community
               ne!
             lo
          da
        an
      St
  +


  vFabric
  Postgres
                                    Ap




                                                                                    e(
                                                                                           Private((
                                       p




                                                                                 fac
                     Data
                                           lica
                     Services
                                                                                           Clouds((




                                                                              ter
                                            'o




                                                                              r(In
                                              n *S

           vFabric




                                                                           ide
                                                  erv


           RabbitMQTM                                                                Public(




                                                                         ov
                                Msg
                                                     ice




                                                                      (Pr
                                Services
                                                                                     Clouds(            Partners(
                                                        *In




                                                                    ud
                                                        ter




                                                                   Cl o
                                                           fac



                                                                                                       .COM
                                                                            Micro(
                                                              e*



                                              Other
                                             Services                       Clouds(
                     Additional partners
                     services …
                                                                                                       A void
                                                                                                       Lo ck-in


                                                                                                              7
Real choice of provider

 Choice of Private    Choice of Public   Choice of Cloud
Cloud Distributions   Cloud Providers     Infrastructure




                         .COM




                                            Bare metal




                                                           8
Deployment tools


          vmc (command line)




                               9
Core services




                10
Developer Perspective
• Program to standard APIs
  – SQL drivers
  – Mongo client libraries
  – ...
• Connection settings from VCAP_SERVICES environment
  variable




                                                       11
When you’re ready to deploy...
     !
     !
       !$!vmc!target!<any!cloud>!
     !!
       !$!vmc!push!<my6app>!
     !
       !!!>!bind!services?!Yes!
     !
       !$!vmc!instances!<my6app>!+100!!
     !
     !
     !     That’s all folks!
                                          12
The sample application

• http://grails.org
• Built with Grails
  – JVM web framework
  – Spring MVC under the hood
  – Groovy as the main development language




                                              13
14
15
16
17
Architecture
                       HTTP



        Controller              View


                                                      Twitter
         Service              REST


                                       Async Plugin
                                         Update
     GORM/Hibernate



            Database
                                                      Forum
                              + Jobs
                                                                18
Single instance


                     Cache
                             Search
               Job
                             indices
                     App
                     Node




           Local, embedded ehcache



                                       19
Single instance


                    Cache
                            Search
              Job
                            indices
                    App
                    Node




             Local Lucene indexes



                                      20
Single instance


                     Cache
                             Search
               Job
                             indices
                     App
                     Node




             Single job of each type



                                       21
Multi-instance


       Cache                         Cache                      Cache
               Search                           Search                   Search
Job                       Job                             Job
               indices                          indices                  indices
       App                           App                        App
       Node                          Node                       Node



3. Return                2. Return                                 3. Return
                                             1. Update
stale data               latest                                    stale data




                                                                                22
Multi-instance


       Cache                         Cache                         Cache
                 Search                        Search                        Search
Job                         Job                             Job
                 indices                       indices                       indices
       App                          App                            App
       Node                         Node                           Node




      Mail Job                    Mail Job                        Mail Job


                           Jobs are executed three times?

                                                                               23
Caching




          Caching shared data
                  ==
             Shared cache




                                24
Ehcache


           Simple & effective
           Distributed mode
           But...



     No multicast on Cloud Foundry!


                                      25
So, what do we use?




•   Key-value store
•   In-memory with persistence (fast)
•   Pub-sub
•   Single service for all app instances




                                           26
Grails Cache plugin

• Based on Spring 3.1 cache abstraction
  – @Cacheable
  – @CacheEvict
• Ehcache & Redis providers
  – Spring Data RedisCacheManager
• <cache:block>
• <cache:render template=”...”>




                                          27
28
HTTP session




               Sticky sessions!




                                  29
HTTP session




         Or consider Redis for
         distributed session store




                                     30
Jobs

• @Scheduled, Quartz, etc.
• Which node runs a job?



        Local data             Shared data




       Do nothing        Quartz JDBC    Worker
                            Store

                                                 31
Distribution with workers
                            Worker
                            Worker
                             Worker




                      ?



    App             App      App
    Node            Node     Node


                                      32
Distribution with workers
                                     Worker
                                     Worker
                                      Worker




                     Node-specific
                        data



    App             App               App
    Node            Node              Node


                                               33
Jobs


                     Pros                   Cons

            Efficient in-JVM       Extra burden on web
            processing             server
  Quartz    Tried & tested
            Relatively simple

            Use right language for Counts against your
            the job                 quota
  Workers   Distribute the workload




                                                         34
Search

• Compass 2.0
  – Lucene indexes on local file system
  – Indexes database data
• > 1 node == stale indexes
• Search as a service
  – Solr
  – Elastic Search
  – Index Tank
  – Amazon Cloud Search
  – Not on Cloud Foundry (yet)
• Synchronise indexes across nodes!
  – Eventual consistency is good enough


                                          35
Synchronisation with an event bus


      Distribute                                   Distribute

                   Distribute

                                        Initiate
                                        event




    Event                       Event                    Event
     bus                         bus                      bus




                                                                 36
Event bus


                                             Update    Call REST
                     Save entity    Index   read DBs    service




Spring Integration                  Event Bus                      AMQP




                        Plugins
                         Plugins
                          Plugins               Application




                                                                          37
Event bus

• Platform Core plugin
  – Event API + simple in-memory implementation
• Events Si plugin
  – Event bus implementation using Spring Integration
• Events Push plugin
  – Bridge events to browser via Atmosphere
• Potentially the standard cloud architecture
  – Message passing (relatively) easy to scale horizontally




                                                              38
Schrödinger’s Cat




            Is the cat alive or dead?

                                        39
Schrödinger’s Cat




           Resolved only when we look

                                        40
Local filesystem
                                  There’s a file in here!




            Does the file exist or not?

                                                       41
Ephemeral file system

• VMs are created and destroyed
  – => application file system created and destroyed
  – You can write to the local file system...
  – ...but you will probably lose that data at some point
• Don’t store persistent data on local FS!
  – File uploads




                                                            42
Wiki images       mongo-file plugin
                    for example


                                  Blob store
                      GridFS




              Controller




                       Upload



               User

                                               43
Logging

• View logs with `vmc logs`
• What if the application instance is restarted?
  – Logs are gone
• What about multiple application instances?
  – `vmc logs --instance 1` or `vmc logs --all`
  – but 30 days after deployment?




                                                   44
Distributed logging              Node.js +
                                 SockJS +
                                 MongoDB




    AMQP               AMQP              AMQP
   Appender           Appender          Appender



    App               App               App
    Node              Node              Node


                                                   45
Config


              Package in the app?


               Store in database?


         Inject via environment variable?




                                            46
Dynamic config load

                            Config.groovy




                      ConfigLoader.groovy




                                       47
Mail

• No SMTP - oh no!
• HTTP providers
  – SendGrid
  – Mailgun
  – Amazon Simple Email Service




                                  48
Easy HTTP Mail
                 resources.groovy




                 MailerJob.groovy




                                    49
Data


       How do we load initial data?


       Perform data migrations?


             Back data up?




                                      50
Access your services

                   Mongo Client




                    vmc tunnel




                     (SSH Tunnel)




                   Cloud Foundry

        MongoDB
         service


                                    51
Import/export




         Import == mysql < data.sql



         Export == mysqldump




                                      52
Application (WIP*)




   Source     https://github.com/grails-samples/grails-website



   Live       http://grails-website.cloudfoundry.com/




* Work in Progress

                                                                 53
Summary

• PaaS is the application platform for the Cloud era
• Cloud Foundry can support real applications
• PaaS will change the way you write apps
  – Design for horizontal scalability
  – Account for ephemeral file system
  – Rich set of services
  – Go polyglot!
• Tools & libraries are important
  – Spring for the win!
• Can use Redis in place of RabbitMQ for some patterns




                                                         54
What’s next?

• Sign up - www.cloudfoundry.com
• Get the source code - www.cloudfoundry.org
• Download your Micro Cloud Foundry –
  my.cloudfoundry.com/micro
• Learn more on the Cloud Foundry blog -
  blog.cloudfoundry.com
• Follow us - @cloudfoundry




                                               55
Q&A

More Related Content

What's hot

Thinking Outside the Container: Deploying Standalone Apps to Cloud Foundry
Thinking Outside the Container: Deploying Standalone Apps to Cloud FoundryThinking Outside the Container: Deploying Standalone Apps to Cloud Foundry
Thinking Outside the Container: Deploying Standalone Apps to Cloud FoundryJennifer Hickey
 
Green Telecom & IT Workshop: Ee routing and networking thierry klein
Green Telecom & IT Workshop: Ee routing and networking   thierry kleinGreen Telecom & IT Workshop: Ee routing and networking   thierry klein
Green Telecom & IT Workshop: Ee routing and networking thierry kleinBellLabs
 
CCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCICCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCIbefreax
 
Infocom03 rajiv
Infocom03 rajivInfocom03 rajiv
Infocom03 rajivzt5169
 
MOW2010: Under the Hood of Oracle Clusterware by Alex Gorbachev, Pythian
MOW2010: Under the Hood of Oracle Clusterware by Alex Gorbachev, PythianMOW2010: Under the Hood of Oracle Clusterware by Alex Gorbachev, Pythian
MOW2010: Under the Hood of Oracle Clusterware by Alex Gorbachev, PythianAlex Gorbachev
 
Strategic Architecture
Strategic ArchitectureStrategic Architecture
Strategic ArchitectureDavid Baker
 

What's hot (7)

Thinking Outside the Container: Deploying Standalone Apps to Cloud Foundry
Thinking Outside the Container: Deploying Standalone Apps to Cloud FoundryThinking Outside the Container: Deploying Standalone Apps to Cloud Foundry
Thinking Outside the Container: Deploying Standalone Apps to Cloud Foundry
 
Asr 9000-line-cards
Asr 9000-line-cardsAsr 9000-line-cards
Asr 9000-line-cards
 
Green Telecom & IT Workshop: Ee routing and networking thierry klein
Green Telecom & IT Workshop: Ee routing and networking   thierry kleinGreen Telecom & IT Workshop: Ee routing and networking   thierry klein
Green Telecom & IT Workshop: Ee routing and networking thierry klein
 
CCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCICCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCI
 
Infocom03 rajiv
Infocom03 rajivInfocom03 rajiv
Infocom03 rajiv
 
MOW2010: Under the Hood of Oracle Clusterware by Alex Gorbachev, Pythian
MOW2010: Under the Hood of Oracle Clusterware by Alex Gorbachev, PythianMOW2010: Under the Hood of Oracle Clusterware by Alex Gorbachev, Pythian
MOW2010: Under the Hood of Oracle Clusterware by Alex Gorbachev, Pythian
 
Strategic Architecture
Strategic ArchitectureStrategic Architecture
Strategic Architecture
 

Similar to Migrating to CloudFoundry

Building an Open Cloud Ecosystem with Cloud Foundry
Building an Open Cloud Ecosystem with Cloud FoundryBuilding an Open Cloud Ecosystem with Cloud Foundry
Building an Open Cloud Ecosystem with Cloud FoundryAndy Piper
 
Hands On CloudFoundry
Hands On CloudFoundryHands On CloudFoundry
Hands On CloudFoundryEric Bottard
 
PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundrymartinlippert
 
Breaking through the Clouds
Breaking through the CloudsBreaking through the Clouds
Breaking through the CloudsAndy Piper
 
Cloud Foundry for Java devs
Cloud Foundry for Java devsCloud Foundry for Java devs
Cloud Foundry for Java devsPeter Ledbrook
 
Spring Data and MongoDB
Spring Data and MongoDBSpring Data and MongoDB
Spring Data and MongoDBOliver Gierke
 
Making a Cleaner Cloud with Open Source
Making a Cleaner Cloud with Open SourceMaking a Cleaner Cloud with Open Source
Making a Cleaner Cloud with Open SourceAndy Piper
 
Portrait of the developer as The Artist - SpringOne India 2012
Portrait of the developer as The Artist - SpringOne India 2012Portrait of the developer as The Artist - SpringOne India 2012
Portrait of the developer as The Artist - SpringOne India 2012Patrick Chanezon
 
What's New in Cloud Foundry
What's New in Cloud FoundryWhat's New in Cloud Foundry
What's New in Cloud FoundryJennifer Hickey
 
Cloud Foundry: Inside the Machine
Cloud Foundry: Inside the MachineCloud Foundry: Inside the Machine
Cloud Foundry: Inside the MachineDerek Collison
 
Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Patrick Chanezon
 
Portrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour SofiaPortrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour SofiaPatrick Chanezon
 
What's Next? Paris - Adrian Colyer Keynote
What's Next? Paris - Adrian Colyer KeynoteWhat's Next? Paris - Adrian Colyer Keynote
What's Next? Paris - Adrian Colyer Keynoteadriancolyer
 
Market Research Report : Cloud Computing Market in India 2010
Market Research Report : Cloud Computing Market in India 2010Market Research Report : Cloud Computing Market in India 2010
Market Research Report : Cloud Computing Market in India 2010Netscribes, Inc.
 
Viii Forum Tlc Federico Protto Presentazione
Viii Forum Tlc Federico Protto PresentazioneViii Forum Tlc Federico Protto Presentazione
Viii Forum Tlc Federico Protto Presentazioneguestd1ae161
 
Badrinath Ramamurthy Cloud Infrastructure
Badrinath Ramamurthy   Cloud InfrastructureBadrinath Ramamurthy   Cloud Infrastructure
Badrinath Ramamurthy Cloud InfrastructureACMBangalore
 
Webinar dnssec for cnrs - 20120209
Webinar dnssec for cnrs - 20120209   Webinar dnssec for cnrs - 20120209
Webinar dnssec for cnrs - 20120209 SURFnet
 
Van innovatie naar een landelijk crisis management systeem
Van innovatie naar een landelijk crisis management systeemVan innovatie naar een landelijk crisis management systeem
Van innovatie naar een landelijk crisis management systeemEsriGISConferentie
 
Cloud foundry - the building of the open paas presentation
Cloud foundry - the building of the open paas presentationCloud foundry - the building of the open paas presentation
Cloud foundry - the building of the open paas presentationXianzhu Yue
 

Similar to Migrating to CloudFoundry (20)

Building an Open Cloud Ecosystem with Cloud Foundry
Building an Open Cloud Ecosystem with Cloud FoundryBuilding an Open Cloud Ecosystem with Cloud Foundry
Building an Open Cloud Ecosystem with Cloud Foundry
 
Hands On CloudFoundry
Hands On CloudFoundryHands On CloudFoundry
Hands On CloudFoundry
 
PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundry
 
Breaking through the Clouds
Breaking through the CloudsBreaking through the Clouds
Breaking through the Clouds
 
Cloud Foundry for Java devs
Cloud Foundry for Java devsCloud Foundry for Java devs
Cloud Foundry for Java devs
 
Spring Data and MongoDB
Spring Data and MongoDBSpring Data and MongoDB
Spring Data and MongoDB
 
Making a Cleaner Cloud with Open Source
Making a Cleaner Cloud with Open SourceMaking a Cleaner Cloud with Open Source
Making a Cleaner Cloud with Open Source
 
Portrait of the developer as The Artist - SpringOne India 2012
Portrait of the developer as The Artist - SpringOne India 2012Portrait of the developer as The Artist - SpringOne India 2012
Portrait of the developer as The Artist - SpringOne India 2012
 
What's New in Cloud Foundry
What's New in Cloud FoundryWhat's New in Cloud Foundry
What's New in Cloud Foundry
 
Cloud Foundry: Inside the Machine
Cloud Foundry: Inside the MachineCloud Foundry: Inside the Machine
Cloud Foundry: Inside the Machine
 
Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012
 
RubyWorld 2011
RubyWorld 2011RubyWorld 2011
RubyWorld 2011
 
Portrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour SofiaPortrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour Sofia
 
What's Next? Paris - Adrian Colyer Keynote
What's Next? Paris - Adrian Colyer KeynoteWhat's Next? Paris - Adrian Colyer Keynote
What's Next? Paris - Adrian Colyer Keynote
 
Market Research Report : Cloud Computing Market in India 2010
Market Research Report : Cloud Computing Market in India 2010Market Research Report : Cloud Computing Market in India 2010
Market Research Report : Cloud Computing Market in India 2010
 
Viii Forum Tlc Federico Protto Presentazione
Viii Forum Tlc Federico Protto PresentazioneViii Forum Tlc Federico Protto Presentazione
Viii Forum Tlc Federico Protto Presentazione
 
Badrinath Ramamurthy Cloud Infrastructure
Badrinath Ramamurthy   Cloud InfrastructureBadrinath Ramamurthy   Cloud Infrastructure
Badrinath Ramamurthy Cloud Infrastructure
 
Webinar dnssec for cnrs - 20120209
Webinar dnssec for cnrs - 20120209   Webinar dnssec for cnrs - 20120209
Webinar dnssec for cnrs - 20120209
 
Van innovatie naar een landelijk crisis management systeem
Van innovatie naar een landelijk crisis management systeemVan innovatie naar een landelijk crisis management systeem
Van innovatie naar een landelijk crisis management systeem
 
Cloud foundry - the building of the open paas presentation
Cloud foundry - the building of the open paas presentationCloud foundry - the building of the open paas presentation
Cloud foundry - the building of the open paas presentation
 

More from GR8Conf

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle GR8Conf
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerGR8Conf
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with GroovyGR8Conf
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with GebGR8Conf
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidGR8Conf
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the DocksGR8Conf
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean CodeGR8Conf
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsGR8Conf
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applicationsGR8Conf
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3GR8Conf
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGR8Conf
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEBGR8Conf
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCGR8Conf
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshopGR8Conf
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spockGR8Conf
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedGR8Conf
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGR8Conf
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and GroovyGR8Conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
 

More from GR8Conf (20)

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Cut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature pluginsCut your Grails application to pieces - build feature plugins
Cut your Grails application to pieces - build feature plugins
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 

Recently uploaded

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 

Recently uploaded (20)

Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 

Migrating to CloudFoundry

  • 1. Migrating to Cloud Foundry Peter Ledbrook - VMware t: @pledbrook e: pledbrook@vmware.com © 2012 VMware, Inc. All rights reserved.
  • 2. What’s happening with applications today? Frameworks are what really matter •  Developer productivity and innovation •  Reduce time to market New application types •  Mobile, Social, SaaS •  Apps released early and often Data intensive •  Emerging requirements: elasticity, multi-cloud •  Web orientation drives exponential data volumes Deployed on virtual and cloud infrastructures •  Virtualization, Cloud, PaaS 2
  • 3. The promise of PaaS App 1 App 2 App 3 Platform Servlet Container Database Other services Infrastructure CPU Memory OS • Zero config • Automatic provisioning 3
  • 4. The Open Platform as a Service Deploy and scale applications in seconds, without locking yourself into a single cloud Open, ple, ble Sim , Scala lexible F
  • 5. Choice of frameworks, services & clouds OSS community ne! lo da an St + 5
  • 6. Choice of frameworks, services & clouds OSS community e! on al a nd St + vFabric Postgres Ap p Data lica Services 'o n *S vFabric erv RabbitMQTM Msg ice Services *In ter fac e* Other Services Additional partners services … 6
  • 7. Choice of frameworks, services & clouds OSS community ne! lo da an St + vFabric Postgres Ap e( Private(( p fac Data lica Services Clouds(( ter 'o r(In n *S vFabric ide erv RabbitMQTM Public( ov Msg ice (Pr Services Clouds( Partners( *In ud ter Cl o fac .COM Micro( e* Other Services Clouds( Additional partners services … A void Lo ck-in 7
  • 8. Real choice of provider Choice of Private Choice of Public Choice of Cloud Cloud Distributions Cloud Providers Infrastructure .COM Bare metal 8
  • 9. Deployment tools vmc (command line) 9
  • 11. Developer Perspective • Program to standard APIs – SQL drivers – Mongo client libraries – ... • Connection settings from VCAP_SERVICES environment variable 11
  • 12. When you’re ready to deploy... ! ! !$!vmc!target!<any!cloud>! !! !$!vmc!push!<my6app>! ! !!!>!bind!services?!Yes! ! !$!vmc!instances!<my6app>!+100!! ! ! ! That’s all folks! 12
  • 13. The sample application • http://grails.org • Built with Grails – JVM web framework – Spring MVC under the hood – Groovy as the main development language 13
  • 14. 14
  • 15. 15
  • 16. 16
  • 17. 17
  • 18. Architecture HTTP Controller View Twitter Service REST Async Plugin Update GORM/Hibernate Database Forum + Jobs 18
  • 19. Single instance Cache Search Job indices App Node Local, embedded ehcache 19
  • 20. Single instance Cache Search Job indices App Node Local Lucene indexes 20
  • 21. Single instance Cache Search Job indices App Node Single job of each type 21
  • 22. Multi-instance Cache Cache Cache Search Search Search Job Job Job indices indices indices App App App Node Node Node 3. Return 2. Return 3. Return 1. Update stale data latest stale data 22
  • 23. Multi-instance Cache Cache Cache Search Search Search Job Job Job indices indices indices App App App Node Node Node Mail Job Mail Job Mail Job Jobs are executed three times? 23
  • 24. Caching Caching shared data == Shared cache 24
  • 25. Ehcache Simple & effective Distributed mode But... No multicast on Cloud Foundry! 25
  • 26. So, what do we use? • Key-value store • In-memory with persistence (fast) • Pub-sub • Single service for all app instances 26
  • 27. Grails Cache plugin • Based on Spring 3.1 cache abstraction – @Cacheable – @CacheEvict • Ehcache & Redis providers – Spring Data RedisCacheManager • <cache:block> • <cache:render template=”...”> 27
  • 28. 28
  • 29. HTTP session Sticky sessions! 29
  • 30. HTTP session Or consider Redis for distributed session store 30
  • 31. Jobs • @Scheduled, Quartz, etc. • Which node runs a job? Local data Shared data Do nothing Quartz JDBC Worker Store 31
  • 32. Distribution with workers Worker Worker Worker ? App App App Node Node Node 32
  • 33. Distribution with workers Worker Worker Worker Node-specific data App App App Node Node Node 33
  • 34. Jobs Pros Cons Efficient in-JVM Extra burden on web processing server Quartz Tried & tested Relatively simple Use right language for Counts against your the job quota Workers Distribute the workload 34
  • 35. Search • Compass 2.0 – Lucene indexes on local file system – Indexes database data • > 1 node == stale indexes • Search as a service – Solr – Elastic Search – Index Tank – Amazon Cloud Search – Not on Cloud Foundry (yet) • Synchronise indexes across nodes! – Eventual consistency is good enough 35
  • 36. Synchronisation with an event bus Distribute Distribute Distribute Initiate event Event Event Event bus bus bus 36
  • 37. Event bus Update Call REST Save entity Index read DBs service Spring Integration Event Bus AMQP Plugins Plugins Plugins Application 37
  • 38. Event bus • Platform Core plugin – Event API + simple in-memory implementation • Events Si plugin – Event bus implementation using Spring Integration • Events Push plugin – Bridge events to browser via Atmosphere • Potentially the standard cloud architecture – Message passing (relatively) easy to scale horizontally 38
  • 39. Schrödinger’s Cat Is the cat alive or dead? 39
  • 40. Schrödinger’s Cat Resolved only when we look 40
  • 41. Local filesystem There’s a file in here! Does the file exist or not? 41
  • 42. Ephemeral file system • VMs are created and destroyed – => application file system created and destroyed – You can write to the local file system... – ...but you will probably lose that data at some point • Don’t store persistent data on local FS! – File uploads 42
  • 43. Wiki images mongo-file plugin for example Blob store GridFS Controller Upload User 43
  • 44. Logging • View logs with `vmc logs` • What if the application instance is restarted? – Logs are gone • What about multiple application instances? – `vmc logs --instance 1` or `vmc logs --all` – but 30 days after deployment? 44
  • 45. Distributed logging Node.js + SockJS + MongoDB AMQP AMQP AMQP Appender Appender Appender App App App Node Node Node 45
  • 46. Config Package in the app? Store in database? Inject via environment variable? 46
  • 47. Dynamic config load Config.groovy ConfigLoader.groovy 47
  • 48. Mail • No SMTP - oh no! • HTTP providers – SendGrid – Mailgun – Amazon Simple Email Service 48
  • 49. Easy HTTP Mail resources.groovy MailerJob.groovy 49
  • 50. Data How do we load initial data? Perform data migrations? Back data up? 50
  • 51. Access your services Mongo Client vmc tunnel (SSH Tunnel) Cloud Foundry MongoDB service 51
  • 52. Import/export Import == mysql < data.sql Export == mysqldump 52
  • 53. Application (WIP*) Source https://github.com/grails-samples/grails-website Live http://grails-website.cloudfoundry.com/ * Work in Progress 53
  • 54. Summary • PaaS is the application platform for the Cloud era • Cloud Foundry can support real applications • PaaS will change the way you write apps – Design for horizontal scalability – Account for ephemeral file system – Rich set of services – Go polyglot! • Tools & libraries are important – Spring for the win! • Can use Redis in place of RabbitMQ for some patterns 54
  • 55. What’s next? • Sign up - www.cloudfoundry.com • Get the source code - www.cloudfoundry.org • Download your Micro Cloud Foundry – my.cloudfoundry.com/micro • Learn more on the Cloud Foundry blog - blog.cloudfoundry.com • Follow us - @cloudfoundry 55
  • 56. Q&A