SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 
CCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCICCA09 Cloud Computing Standards and OCCI
CCA09 Cloud Computing Standards and OCCIbefreax
 
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
 
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 rajivzt5169
 

Was ist angesagt? (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
 

Ähnlich wie Migrating to Cloud Foundry: Deploy and Scale Apps in Seconds

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
 
Breaking through the Clouds
Breaking through the CloudsBreaking through the Clouds
Breaking through the CloudsAndy Piper
 
Hands On CloudFoundry
Hands On CloudFoundryHands On CloudFoundry
Hands On CloudFoundryEric 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 SourceAndy Piper
 
PaaS Parade - Cloud Foundry
PaaS Parade - Cloud FoundryPaaS Parade - Cloud Foundry
PaaS Parade - Cloud Foundrymartinlippert
 
Spring Data and MongoDB
Spring Data and MongoDBSpring Data and MongoDB
Spring Data and MongoDBOliver Gierke
 
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 for Java devs
Cloud Foundry for Java devsCloud Foundry for Java devs
Cloud Foundry for Java devsPeter Ledbrook
 
Cloud Foundry: Inside the Machine
Cloud Foundry: Inside the MachineCloud Foundry: Inside the Machine
Cloud Foundry: Inside the MachineDerek 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 2012Patrick Chanezon
 

Ähnlich wie Migrating to Cloud Foundry: Deploy and Scale Apps in Seconds (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
 

Mehr von Peter Ledbrook

Improving your Gradle builds
Improving your Gradle buildsImproving your Gradle builds
Improving your Gradle buildsPeter Ledbrook
 
Why your build matters
Why your build mattersWhy your build matters
Why your build mattersPeter Ledbrook
 
Groovy for Java Developers
Groovy for Java DevelopersGroovy for Java Developers
Groovy for Java DevelopersPeter Ledbrook
 
Application Architectures in Grails
Application Architectures in GrailsApplication Architectures in Grails
Application Architectures in GrailsPeter 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-2013Peter Ledbrook
 
Groovy & Grails for Spring/Java developers
Groovy & Grails for Spring/Java developersGroovy & Grails for Spring/Java developers
Groovy & Grails for Spring/Java developersPeter Ledbrook
 
Grails & the World of Tomorrow
Grails & the World of TomorrowGrails & the World of Tomorrow
Grails & the World of TomorrowPeter Ledbrook
 
Grails and the World of Tomorrow
Grails and the World of TomorrowGrails and the World of Tomorrow
Grails and the World of TomorrowPeter Ledbrook
 

Mehr von 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
 

Kürzlich hochgeladen

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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 write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
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
 
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
 
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
 

Kürzlich hochgeladen (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
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
 
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 write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
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.
 
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
 
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
 

Migrating to Cloud Foundry: Deploy and Scale Apps in Seconds

  • 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