SlideShare a Scribd company logo
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 Foundry
Jennifer Hickey
 
Asr 9000-line-cards
Asr 9000-line-cardsAsr 9000-line-cards
Asr 9000-line-cards
Fajar Isnanto
 
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
BellLabs
 
CCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCICCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCI
befreax
 
Infocom03 rajiv
Infocom03 rajivInfocom03 rajiv
Infocom03 rajiv
zt5169
 
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
Alex Gorbachev
 
Strategic Architecture
Strategic ArchitectureStrategic Architecture
Strategic Architecture
David 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 Foundry
Andy Piper
 
Hands On CloudFoundry
Hands On CloudFoundryHands On CloudFoundry
Hands On CloudFoundry
Eric Bottard
 
PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundry
martinlippert
 
Breaking through the Clouds
Breaking through the CloudsBreaking through the Clouds
Breaking through the Clouds
Andy Piper
 
Cloud Foundry for Java devs
Cloud Foundry for Java devsCloud Foundry for Java devs
Cloud Foundry for Java devs
Peter Ledbrook
 
Spring Data and MongoDB
Spring Data and MongoDBSpring Data and MongoDB
Spring Data and MongoDB
Oliver 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 Source
Andy 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 2012
Patrick Chanezon
 
What's New in Cloud Foundry
What's New in Cloud FoundryWhat's New in Cloud Foundry
What's New in Cloud Foundry
Jennifer Hickey
 
Cloud Foundry: Inside the Machine
Cloud Foundry: Inside the MachineCloud Foundry: Inside the Machine
Cloud Foundry: Inside the Machine
Derek Collison
 
Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012
Patrick Chanezon
 
RubyWorld 2011
RubyWorld 2011RubyWorld 2011
RubyWorld 2011
Derek Collison
 
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
Patrick 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 Keynote
adriancolyer
 
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
Netscribes, Inc.
 
Viii Forum Tlc Federico Protto Presentazione
Viii Forum Tlc Federico Protto PresentazioneViii Forum Tlc Federico Protto Presentazione
Viii Forum Tlc Federico Protto Presentazione
guestd1ae161
 
Badrinath Ramamurthy Cloud Infrastructure
Badrinath Ramamurthy   Cloud InfrastructureBadrinath Ramamurthy   Cloud Infrastructure
Badrinath Ramamurthy Cloud Infrastructure
ACMBangalore
 
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 systeem
EsriGISConferentie
 
OSCON 2011
OSCON 2011OSCON 2011
OSCON 2011
Derek Collison
 

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
 
OSCON 2011
OSCON 2011OSCON 2011
OSCON 2011
 

More from GR8Conf

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
GR8Conf
 
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 developer
GR8Conf
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
GR8Conf
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
GR8Conf
 
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
GR8Conf
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
GR8Conf
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
GR8Conf
 
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
GR8Conf
 
Performance tuning Grails applications
 Performance tuning Grails applications Performance tuning Grails applications
Performance tuning Grails applications
GR8Conf
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
GR8Conf
 
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
GR8Conf
 
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
GR8Conf
 
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
GR8Conf
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
GR8Conf
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
GR8Conf
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
GR8Conf
 
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
GR8Conf
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
GR8Conf
 
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
GR8Conf
 

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

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 

Recently uploaded (20)

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 

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