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 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
  +




                                                  4
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 …




                                                                               5
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


                                                                                                              6
Real choice of provider

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




                         .COM




                                            Bare metal




                                                           7
Deployment tools


          vmc (command line)




                               8
Core services




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




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

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




                                              12
13
14
15
16
Architecture
                       HTTP



        Controller              View


                                                      Twitter
         Service              REST


                                       Async Plugin
                                         Update
     GORM/Hibernate



            Database
                                                      Forum
                              + Jobs
                                                                17
Single instance


                     Cache
                             Search
               Job
                             indices
                     App
                     Node




           Local, embedded ehcache



                                       18
Single instance


                    Cache
                            Search
              Job
                            indices
                    App
                    Node




             Local Lucene indexes



                                      19
Single instance


                     Cache
                             Search
               Job
                             indices
                     App
                     Node




             Single job of each type



                                       20
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




                                                                                21
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?

                                                                               22
Caching




          Caching shared data
                  ==
             Shared cache




                                23
Ehcache


           Simple & effective
           Distributed mode
           But...



     No multicast on Cloud Foundry!


                                      24
So, what do we use?




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




                                           25
Grails Cache plugin

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




                                          26
27
HTTP session




               Sticky sessions!




                                  28
HTTP session




         Or consider Redis for
         distributed session store




                                     29
Jobs

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



        Local data             Shared data




       Do nothing        Quartz JDBC    Worker
                            Store

                                                 30
Distribution with workers
                            Worker
                            Worker
                             Worker




                      ?



    App             App      App
    Node            Node     Node


                                      31
Distribution with workers
                                     Worker
                                     Worker
                                      Worker




                     Node-specific
                        data



    App             App               App
    Node            Node              Node


                                               32
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




                                                         33
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


                                          34
Synchronisation with an event bus


      Distribute                                   Distribute

                   Distribute

                                        Initiate
                                        event




    Event                       Event                    Event
     bus                         bus                      bus




                                                                 35
Schrödinger’s Cat
                                 There’s a cat in here!




            Is the cat alive or dead?




                                                     36
Local filesystem
                                  There’s a file in here!




            Does the file exist or not?




                                                       37
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




                                                            38
Wiki images


                                Blob store
                      GridFS




              Controller




                       Upload



               User

                                             39
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?




                                                   40
Distributed logging              Node.js +
                                 SockJS +
                                 MongoDB




    AMQP               AMQP              AMQP
   Appender           Appender          Appender



    App               App               App
    Node              Node              Node


                                                   41
Config


              Package in the app?


               Store in database?


         Inject via environment variable?




                                            42
Dynamic config load

                            Config.groovy




                      ConfigLoader.groovy




                                       43
Mail

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




                                  44
Easy HTTP Mail
                 resources.groovy




                 MailerJob.groovy




                                    45
Data


       How do we load initial data?


       Perform data migrations?


             Back data up?




                                      46
Access your services

                   Mongo Client




                    vmc tunnel




                     (SSH Tunnel)




                   Cloud Foundry

        MongoDB
         service


                                    47
Import/export




         Import == mysql < data.sql



         Export == mysqldump




                                      48
Application (WIP*)




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



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




* Work in Progress

                                                                 49
Summary

• PaaS is the application platform for the Cloud era
• 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




                                                         50
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




                                               51
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
 
CCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCICCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCI
befreax
 
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
 
Petrobras´ Business Plan - Investment Opportunities | CEO José Sergio Gabriel...
Petrobras´ Business Plan - Investment Opportunities | CEO José Sergio Gabriel...Petrobras´ Business Plan - Investment Opportunities | CEO José Sergio Gabriel...
Petrobras´ Business Plan - Investment Opportunities | CEO José Sergio Gabriel...
Petrobras
 
Infocom03 rajiv
Infocom03 rajivInfocom03 rajiv
Infocom03 rajiv
zt5169
 

What's hot (6)

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
 
CCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCICCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCI
 
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
 
Petrobras´ Business Plan - Investment Opportunities | CEO José Sergio Gabriel...
Petrobras´ Business Plan - Investment Opportunities | CEO José Sergio Gabriel...Petrobras´ Business Plan - Investment Opportunities | CEO José Sergio Gabriel...
Petrobras´ Business Plan - Investment Opportunities | CEO José Sergio Gabriel...
 
Infocom03 rajiv
Infocom03 rajivInfocom03 rajiv
Infocom03 rajiv
 

Similar to Migrating to Cloud Foundry

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
 
Breaking through the Clouds
Breaking through the CloudsBreaking through the Clouds
Breaking through the Clouds
Andy Piper
 
Hands On CloudFoundry
Hands On CloudFoundryHands On CloudFoundry
Hands On CloudFoundry
Eric Bottard
 
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
 
PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundry
martinlippert
 
Spring Data and MongoDB
Spring Data and MongoDBSpring Data and MongoDB
Spring Data and MongoDB
Oliver Gierke
 
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 for Java devs
Cloud Foundry for Java devsCloud Foundry for Java devs
Cloud Foundry for Java devs
Peter Ledbrook
 
Cloud Foundry: Inside the Machine
Cloud Foundry: Inside the MachineCloud Foundry: Inside the Machine
Cloud Foundry: Inside the Machine
Derek Collison
 
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
 

Similar to Migrating to Cloud Foundry (10)

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
 
Breaking through the Clouds
Breaking through the CloudsBreaking through the Clouds
Breaking through the Clouds
 
Hands On CloudFoundry
Hands On CloudFoundryHands On CloudFoundry
Hands On CloudFoundry
 
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
 
PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundry
 
Spring Data and MongoDB
Spring Data and MongoDBSpring Data and MongoDB
Spring Data and MongoDB
 
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 for Java devs
Cloud Foundry for Java devsCloud Foundry for Java devs
Cloud Foundry for Java devs
 
Cloud Foundry: Inside the Machine
Cloud Foundry: Inside the MachineCloud Foundry: Inside the Machine
Cloud Foundry: Inside the Machine
 
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
 

More from Peter Ledbrook

Why Gradle?
Why Gradle?Why Gradle?
Why Gradle?
Peter Ledbrook
 
Improving your Gradle builds
Improving your Gradle buildsImproving your Gradle builds
Improving your Gradle builds
Peter Ledbrook
 
Why your build matters
Why your build mattersWhy your build matters
Why your build matters
Peter Ledbrook
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
Peter Ledbrook
 
Application Architectures in Grails
Application Architectures in GrailsApplication Architectures in Grails
Application Architectures in Grails
Peter Ledbrook
 
Open source-and-you-gr8conf-us-2013
Open source-and-you-gr8conf-us-2013Open source-and-you-gr8conf-us-2013
Open source-and-you-gr8conf-us-2013
Peter Ledbrook
 
Groovy & Grails for Spring/Java developers
Groovy & Grails for Spring/Java developersGroovy & Grails for Spring/Java developers
Groovy & Grails for Spring/Java developers
Peter Ledbrook
 
Grails & the World of Tomorrow
Grails & the World of TomorrowGrails & the World of Tomorrow
Grails & the World of Tomorrow
Peter Ledbrook
 
Grails 2.0 Update
Grails 2.0 UpdateGrails 2.0 Update
Grails 2.0 Update
Peter Ledbrook
 
Grails and the World of Tomorrow
Grails and the World of TomorrowGrails and the World of Tomorrow
Grails and the World of Tomorrow
Peter Ledbrook
 

More from Peter Ledbrook (10)

Why Gradle?
Why Gradle?Why Gradle?
Why Gradle?
 
Improving your Gradle builds
Improving your Gradle buildsImproving your Gradle builds
Improving your Gradle builds
 
Why your build matters
Why your build mattersWhy your build matters
Why your build matters
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java Developers
 
Application Architectures in Grails
Application Architectures in GrailsApplication Architectures in Grails
Application Architectures in Grails
 
Open source-and-you-gr8conf-us-2013
Open source-and-you-gr8conf-us-2013Open source-and-you-gr8conf-us-2013
Open source-and-you-gr8conf-us-2013
 
Groovy & Grails for Spring/Java developers
Groovy & Grails for Spring/Java developersGroovy & Grails for Spring/Java developers
Groovy & Grails for Spring/Java developers
 
Grails & the World of Tomorrow
Grails & the World of TomorrowGrails & the World of Tomorrow
Grails & the World of Tomorrow
 
Grails 2.0 Update
Grails 2.0 UpdateGrails 2.0 Update
Grails 2.0 Update
 
Grails and the World of Tomorrow
Grails and the World of TomorrowGrails and the World of Tomorrow
Grails and the World of Tomorrow
 

Recently uploaded

BEGINNER’S GUIDE TO AI AGENTS (1).pptx...
BEGINNER’S GUIDE TO AI AGENTS (1).pptx...BEGINNER’S GUIDE TO AI AGENTS (1).pptx...
BEGINNER’S GUIDE TO AI AGENTS (1).pptx...
WriteMe
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
Priyanka Aash
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Networks
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Overview of Enterprise-scale landing zones using Cloud Adoption Framework Rea...
Overview of Enterprise-scale landing zones using Cloud Adoption Framework Rea...Overview of Enterprise-scale landing zones using Cloud Adoption Framework Rea...
Overview of Enterprise-scale landing zones using Cloud Adoption Framework Rea...
MarceloMiranda38200
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptxDublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Kunal Gupta
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
Gen-AI in Telcos: Strategies, Challenges & Impact
Gen-AI in Telcos: Strategies, Challenges & ImpactGen-AI in Telcos: Strategies, Challenges & Impact
Gen-AI in Telcos: Strategies, Challenges & Impact
aejazahamed4
 
Empowering Businesses in the Digital Age
Empowering Businesses in the Digital AgeEmpowering Businesses in the Digital Age
Empowering Businesses in the Digital Age
Bert Blevins
 

Recently uploaded (20)

BEGINNER’S GUIDE TO AI AGENTS (1).pptx...
BEGINNER’S GUIDE TO AI AGENTS (1).pptx...BEGINNER’S GUIDE TO AI AGENTS (1).pptx...
BEGINNER’S GUIDE TO AI AGENTS (1).pptx...
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
(CISOPlatform Summit & SACON 2024) Keynote _ Power Digital Identities With AI...
 
IPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite SolutionIPLOOK Remote-Sensing Satellite Solution
IPLOOK Remote-Sensing Satellite Solution
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Overview of Enterprise-scale landing zones using Cloud Adoption Framework Rea...
Overview of Enterprise-scale landing zones using Cloud Adoption Framework Rea...Overview of Enterprise-scale landing zones using Cloud Adoption Framework Rea...
Overview of Enterprise-scale landing zones using Cloud Adoption Framework Rea...
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptxDublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
Dublin_mulesoft_meetup_Mulesoft_Salesforce_Integration (1).pptx
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
Gen-AI in Telcos: Strategies, Challenges & Impact
Gen-AI in Telcos: Strategies, Challenges & ImpactGen-AI in Telcos: Strategies, Challenges & Impact
Gen-AI in Telcos: Strategies, Challenges & Impact
 
Empowering Businesses in the Digital Age
Empowering Businesses in the Digital AgeEmpowering Businesses in the Digital Age
Empowering Businesses in the Digital Age
 

Migrating to Cloud Foundry

  • 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 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
  • 4. Choice of frameworks, services & clouds OSS community ne! lo da an St + 4
  • 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 … 5
  • 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 6
  • 7. Real choice of provider Choice of Private Choice of Public Choice of Cloud Cloud Distributions Cloud Providers Infrastructure .COM Bare metal 7
  • 8. Deployment tools vmc (command line) 8
  • 10. Developer Perspective • Program to standard APIs – SQL drivers – Mongo client libraries – ... • Connection settings from VCAP_SERVICES environment variable 10
  • 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! 11
  • 12. The sample application • http://grails.org • Built with Grails – JVM web framework – Spring MVC under the hood – Groovy as the main development language 12
  • 13. 13
  • 14. 14
  • 15. 15
  • 16. 16
  • 17. Architecture HTTP Controller View Twitter Service REST Async Plugin Update GORM/Hibernate Database Forum + Jobs 17
  • 18. Single instance Cache Search Job indices App Node Local, embedded ehcache 18
  • 19. Single instance Cache Search Job indices App Node Local Lucene indexes 19
  • 20. Single instance Cache Search Job indices App Node Single job of each type 20
  • 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 21
  • 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? 22
  • 23. Caching Caching shared data == Shared cache 23
  • 24. Ehcache Simple & effective Distributed mode But... No multicast on Cloud Foundry! 24
  • 25. So, what do we use? • Key-value store • In-memory with persistence (fast) • Pub-sub • Single service for all app instances 25
  • 26. Grails Cache plugin • Based on Spring 3.1 cache abstraction – @Cacheable – @CacheEvict • Ehcache & Redis providers – Spring Data RedisCacheManager • <cache:block> • <cache:render template=”...”> 26
  • 27. 27
  • 28. HTTP session Sticky sessions! 28
  • 29. HTTP session Or consider Redis for distributed session store 29
  • 30. Jobs • @Scheduled, Quartz, etc. • Which node runs a job? Local data Shared data Do nothing Quartz JDBC Worker Store 30
  • 31. Distribution with workers Worker Worker Worker ? App App App Node Node Node 31
  • 32. Distribution with workers Worker Worker Worker Node-specific data App App App Node Node Node 32
  • 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 33
  • 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 34
  • 35. Synchronisation with an event bus Distribute Distribute Distribute Initiate event Event Event Event bus bus bus 35
  • 36. Schrödinger’s Cat There’s a cat in here! Is the cat alive or dead? 36
  • 37. Local filesystem There’s a file in here! Does the file exist or not? 37
  • 38. 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 38
  • 39. Wiki images Blob store GridFS Controller Upload User 39
  • 40. 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? 40
  • 41. Distributed logging Node.js + SockJS + MongoDB AMQP AMQP AMQP Appender Appender Appender App App App Node Node Node 41
  • 42. Config Package in the app? Store in database? Inject via environment variable? 42
  • 43. Dynamic config load Config.groovy ConfigLoader.groovy 43
  • 44. Mail • No SMTP - oh no! • HTTP providers – SendGrid – Mailgun – Amazon Simple Email Service 44
  • 45. Easy HTTP Mail resources.groovy MailerJob.groovy 45
  • 46. Data How do we load initial data? Perform data migrations? Back data up? 46
  • 47. Access your services Mongo Client vmc tunnel (SSH Tunnel) Cloud Foundry MongoDB service 47
  • 48. Import/export Import == mysql < data.sql Export == mysqldump 48
  • 49. Application (WIP*) Source https://github.com/grails-samples/grails-website Live http://grails-website.cloudfoundry.com/ * Work in Progress 49
  • 50. Summary • PaaS is the application platform for the Cloud era • 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 50
  • 51. 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 51
  • 52. Q&A