SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
NoRedeploys
      Instant	
  updates	
  for	
  dev	
  and	
  prod


      Anton	
  Arhipov
      Product	
  Lead,	
  JRebel
      @antonarhipov	
  @javarebel


Saturday, April 21, 12
!!!WARNING!!!




Saturday, April 21, 12
Turnaround	
  cycle
                                     Make	
  a	
  
                                     change



                         Check	
                      Build,
                          the	
                      deploy,
                         result                       wait

Saturday, April 21, 12
Build
                                Resolve	
  dependencies

                                Copy	
  staGc	
  resources

                                    Compile	
  classes

                             Package	
  modules	
  into	
  JARs

                         Package	
  everything	
  into	
  WAR/EAR
Saturday, April 21, 12
Build
                                Resolve	
  dependencies

                                Copy	
  staGc	
  resources

                                    Compile	
  classes

                             Package	
  modules	
  into	
  JARs

                         Package	
  everything	
  into	
  WAR/EAR
Saturday, April 21, 12
Exploded	
  Directory	
  Deployment




Saturday, April 21, 12
Exploded	
  Directory	
  Deployment




Saturday, April 21, 12
JeAy	
  Launcher
  public class Launcher {

       public static void main(String[] args) {

           Server server = new Server();

           SelectChannelConnector connector
                                = new SelectChannelConnector();
           connector.setPort(8080);
           server.addConnector(connector);

           WebAppContext context = new WebAppContext("war", "/");
           server.setHandler(context);
           server.start();

       }

  }
Saturday, April 21, 12
Deployment

      1–60s                     30s	
  –	
  15min       ~1min



                         applicaBon	
  deployment	
  
                           container	
  boot	
  Bme
                               navigaBon

Saturday, April 21, 12
Deployment

      1–60s                     30s	
  –	
  15min           ~1min
                                                      OOM



                         applicaBon	
  deployment	
  
                           container	
  boot	
  Bme
                               navigaBon

Saturday, April 21, 12
OutOfMemoryError
                         DEMO

Saturday, April 21, 12
Externalized,         Temporary,

                         State%

         Serializable,        Deriva6ve,

Saturday, April 21, 12
Reloading	
  Classes

                                OldClassLoader




                           MyObject.class




                         MyObject




Saturday, April 21, 12
Reloading	
  Classes

                                OldClassLoader   NewClassLoader




                           MyObject.class




                         MyObject




Saturday, April 21, 12
Reloading	
  Classes

                                OldClassLoader              NewClassLoader




                           MyObject.class                        MyObject.class




                                            Recreate	
  object
                         MyObject                                       MyObject




Saturday, April 21, 12
Web	
  ApplicaBon	
  Redeployment	
  
                          Process


                         Session
         Classes             Servlet

                              State
        Libraries


              OldClassLoader
Saturday, April 21, 12
Web	
  ApplicaBon	
  Redeployment	
  
                          Process


                         Session
         Classes             Servlet

                              State
        Libraries


              OldClassLoader           NewClassLoader
Saturday, April 21, 12
Web	
  ApplicaBon	
  Redeployment	
  
                          Process


                         Session
         Classes             Servlet   Classes


                              State
        Libraries                      Libraries


              OldClassLoader             NewClassLoader
Saturday, April 21, 12
Web	
  ApplicaBon	
  Redeployment	
  
                          Process


                         Session
         Classes             Servlet   Classes     Servlet

                              State
        Libraries                      Libraries


              OldClassLoader             NewClassLoader
Saturday, April 21, 12
Web	
  ApplicaBon	
  Redeployment	
  
                          Process
                                                     init()

                         Session
         Classes             Servlet   Classes     Servlet

                              State                State
        Libraries                      Libraries


              OldClassLoader             NewClassLoader
Saturday, April 21, 12
Web	
  ApplicaBon	
  Redeployment	
  
                          Process
                                          Serialize/deserialize


                         Session                   Session
         Classes             Servlet   Classes         Servlet

                              State                     State
        Libraries                      Libraries


              OldClassLoader             NewClassLoader
Saturday, April 21, 12
Web	
  ApplicaBon	
  Redeployment	
  
                          Process


                         Session                   Session
         Classes             Servlet   Classes         Servlet

                              State                     State
        Libraries                      Libraries


              OldClassLoader             NewClassLoader
Saturday, April 21, 12
Web	
  ApplicaBon	
  Redeployment	
  
                          Process


                                            Session
                                 Classes        Servlet

                                                 State
                                Libraries


                                  NewClassLoader
Saturday, April 21, 12
Web	
  ApplicaBon	
  Redeployment	
  
                          Process


                         Session                   Session
         Classes             Servlet   Classes         Servlet

                              State                     State
        Libraries                      Libraries


              OldClassLoader             NewClassLoader
Saturday, April 21, 12
OutOfMemoryError
                         Simulation

Saturday, April 21, 12
hAp://zeroturnaround.com/java-­‐ee-­‐producBvity-­‐report-­‐2011/
Saturday, April 21, 12
HotSwap
                                                        Make	
  changes	
  in	
  IDE
                     ClassLoader




                     MyObject.class
                     Code
                     101000101                               HotSwap
                     100010010            New	
  code
                                          111000100
                                          101010010




                         MyObject




Saturday, April 21, 12
JRebel
                                                        Make	
  changes	
  in	
  IDE
                     ClassLoader




                     MyObject.class
                     Code
                     101000101
                                          New	
  code
                                                            JRebel
                     100010010
                                          111000100
                                          101010010




                         MyObject




Saturday, April 21, 12
Hotswap	
  vs	
  JRebel
                         JRebel&vs&HotSwap&
                                     Hotswap
                                       HotSwap(    JRebel
                                                     JRebel(
     Changing&method&bodies&              +(          +(
     Adding/removing&methods&             ;&          +&
     Adding/removing&constructors&        ;&          +&
     Adding/removing&fields&               ;&          +&
     Adding/removing&classes&             ;&          +&
     Adding/removing&annota?ons&          ;&          +&
     Replacing&superclass&                ;&          ;&
     Adding/removing&implemented&         ;&          ;&
     interfaces&
Saturday, April 21, 12
JRebel
                                                        Make	
  changes	
  in	
  IDE
                     ClassLoader




                     MyObject.class
                     Code
                     101000101
                                          New	
  code
                                                            JRebel
                     100010010
                                          111000100
                                          101010010




                         MyObject




Saturday, April 21, 12
JRebel
                                                        Make	
  changes	
  in	
  IDE
                     ClassLoader
  Framework



                     MyObject.class
                     Code
                     101000101
                                          New	
  code
                                                            JRebel
                     100010010
                                          111000100
                                          101010010




                         MyObject




Saturday, April 21, 12
JRebel
                                                          Make	
  changes	
  in	
  IDE
                     ClassLoader
  Framework



                     MyObject.class
                     Code
                     101000101
                                          New	
  code
                                                              JRebel
                     100010010
                                          111000100
                                          101010010




                         MyObject
                                                 ConfiguraGon
                                              (XML,	
  annotaGons,..)



Saturday, April 21, 12
getResource(“hello.html”)           read(“src/main/.../hello.html”)


                            virtual	
  mapping

                                MyApp.war

Saturday, April 21, 12
in	
  acBon
Saturday, April 21, 12
JRebel	
  IntegraBon




  hAp://zeroturnaround.com/jrebel/features/frameworks/
Saturday, April 21, 12
What	
  About	
  Live	
  
                    Environments?


Saturday, April 21, 12
Saturday, April 21, 12
Saturday, April 21, 12
• LiveRebel	
  updates	
  are
            – Online
            – Automated
            – TransacBonal
            – 100%	
  Reversible
            – Instant


Saturday, April 21, 12
?   32

Saturday, April 21, 12

Weitere ähnliche Inhalte

Mehr von Anton Arhipov

Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Anton Arhipov
 
Devclub 01/2017 - (Не)адекватное Java-интервью
Devclub 01/2017 - (Не)адекватное Java-интервьюDevclub 01/2017 - (Не)адекватное Java-интервью
Devclub 01/2017 - (Не)адекватное Java-интервью
Anton Arhipov
 

Mehr von Anton Arhipov (20)

Build pipelines with TeamCity
Build pipelines with TeamCityBuild pipelines with TeamCity
Build pipelines with TeamCity
 
Devoxx Ukraine 2018 - Kotlin DSL in under an hour
Devoxx Ukraine 2018 - Kotlin DSL in under an hourDevoxx Ukraine 2018 - Kotlin DSL in under an hour
Devoxx Ukraine 2018 - Kotlin DSL in under an hour
 
GeeCON Prague 2018 - Kotlin DSL in under an hour
GeeCON Prague 2018 - Kotlin DSL in under an hourGeeCON Prague 2018 - Kotlin DSL in under an hour
GeeCON Prague 2018 - Kotlin DSL in under an hour
 
Build pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSLBuild pipelines with TeamCity and Kotlin DSL
Build pipelines with TeamCity and Kotlin DSL
 
Build pipelines with TeamCity
Build pipelines with TeamCityBuild pipelines with TeamCity
Build pipelines with TeamCity
 
JavaDay Kiev 2017 - Integration testing with TestContainers
JavaDay Kiev 2017 - Integration testing with TestContainersJavaDay Kiev 2017 - Integration testing with TestContainers
JavaDay Kiev 2017 - Integration testing with TestContainers
 
GeeCON Prague 2017 - TestContainers
GeeCON Prague 2017 - TestContainersGeeCON Prague 2017 - TestContainers
GeeCON Prague 2017 - TestContainers
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
 
JavaOne 2017 - TestContainers: integration testing without the hassle
JavaOne 2017 - TestContainers: integration testing without the hassleJavaOne 2017 - TestContainers: integration testing without the hassle
JavaOne 2017 - TestContainers: integration testing without the hassle
 
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloadingJavaOne 2017 - The hitchhiker’s guide to Java class reloading
JavaOne 2017 - The hitchhiker’s guide to Java class reloading
 
JavaZone 2017 - The Hitchhiker’s guide to Java class reloading
JavaZone 2017 - The Hitchhiker’s guide to Java class reloadingJavaZone 2017 - The Hitchhiker’s guide to Java class reloading
JavaZone 2017 - The Hitchhiker’s guide to Java class reloading
 
JUG.ua 20170225 - Java bytecode instrumentation
JUG.ua 20170225 - Java bytecode instrumentationJUG.ua 20170225 - Java bytecode instrumentation
JUG.ua 20170225 - Java bytecode instrumentation
 
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloadingRiga DevDays 2017 - The hitchhiker’s guide to Java class reloading
Riga DevDays 2017 - The hitchhiker’s guide to Java class reloading
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassle
 
JEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloadingJEEConf 2017 - The hitchhiker’s guide to Java class reloading
JEEConf 2017 - The hitchhiker’s guide to Java class reloading
 
JEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with JavassistJEEConf 2017 - Having fun with Javassist
JEEConf 2017 - Having fun with Javassist
 
Devclub 01/2017 - (Не)адекватное Java-интервью
Devclub 01/2017 - (Не)адекватное Java-интервьюDevclub 01/2017 - (Не)адекватное Java-интервью
Devclub 01/2017 - (Не)адекватное Java-интервью
 
Joker 2016 - Bytecode 101
Joker 2016 - Bytecode 101Joker 2016 - Bytecode 101
Joker 2016 - Bytecode 101
 
JPoint 2016 - Etudes of DIY Java profiler
JPoint 2016 - Etudes of DIY Java profilerJPoint 2016 - Etudes of DIY Java profiler
JPoint 2016 - Etudes of DIY Java profiler
 
JPoint 2016 - Bytecode
JPoint 2016 - BytecodeJPoint 2016 - Bytecode
JPoint 2016 - Bytecode
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

NoRedeploys: instant updates for dev and prod

  • 1. NoRedeploys Instant  updates  for  dev  and  prod Anton  Arhipov Product  Lead,  JRebel @antonarhipov  @javarebel Saturday, April 21, 12
  • 3. Turnaround  cycle Make  a   change Check   Build, the   deploy, result wait Saturday, April 21, 12
  • 4. Build Resolve  dependencies Copy  staGc  resources Compile  classes Package  modules  into  JARs Package  everything  into  WAR/EAR Saturday, April 21, 12
  • 5. Build Resolve  dependencies Copy  staGc  resources Compile  classes Package  modules  into  JARs Package  everything  into  WAR/EAR Saturday, April 21, 12
  • 8. JeAy  Launcher public class Launcher { public static void main(String[] args) { Server server = new Server(); SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(8080); server.addConnector(connector); WebAppContext context = new WebAppContext("war", "/"); server.setHandler(context); server.start(); } } Saturday, April 21, 12
  • 9. Deployment 1–60s 30s  –  15min ~1min applicaBon  deployment   container  boot  Bme navigaBon Saturday, April 21, 12
  • 10. Deployment 1–60s 30s  –  15min ~1min OOM applicaBon  deployment   container  boot  Bme navigaBon Saturday, April 21, 12
  • 11. OutOfMemoryError DEMO Saturday, April 21, 12
  • 12. Externalized, Temporary, State% Serializable, Deriva6ve, Saturday, April 21, 12
  • 13. Reloading  Classes OldClassLoader MyObject.class MyObject Saturday, April 21, 12
  • 14. Reloading  Classes OldClassLoader NewClassLoader MyObject.class MyObject Saturday, April 21, 12
  • 15. Reloading  Classes OldClassLoader NewClassLoader MyObject.class MyObject.class Recreate  object MyObject MyObject Saturday, April 21, 12
  • 16. Web  ApplicaBon  Redeployment   Process Session Classes Servlet State Libraries OldClassLoader Saturday, April 21, 12
  • 17. Web  ApplicaBon  Redeployment   Process Session Classes Servlet State Libraries OldClassLoader NewClassLoader Saturday, April 21, 12
  • 18. Web  ApplicaBon  Redeployment   Process Session Classes Servlet Classes State Libraries Libraries OldClassLoader NewClassLoader Saturday, April 21, 12
  • 19. Web  ApplicaBon  Redeployment   Process Session Classes Servlet Classes Servlet State Libraries Libraries OldClassLoader NewClassLoader Saturday, April 21, 12
  • 20. Web  ApplicaBon  Redeployment   Process init() Session Classes Servlet Classes Servlet State State Libraries Libraries OldClassLoader NewClassLoader Saturday, April 21, 12
  • 21. Web  ApplicaBon  Redeployment   Process Serialize/deserialize Session Session Classes Servlet Classes Servlet State State Libraries Libraries OldClassLoader NewClassLoader Saturday, April 21, 12
  • 22. Web  ApplicaBon  Redeployment   Process Session Session Classes Servlet Classes Servlet State State Libraries Libraries OldClassLoader NewClassLoader Saturday, April 21, 12
  • 23. Web  ApplicaBon  Redeployment   Process Session Classes Servlet State Libraries NewClassLoader Saturday, April 21, 12
  • 24. Web  ApplicaBon  Redeployment   Process Session Session Classes Servlet Classes Servlet State State Libraries Libraries OldClassLoader NewClassLoader Saturday, April 21, 12
  • 25. OutOfMemoryError Simulation Saturday, April 21, 12
  • 27. HotSwap Make  changes  in  IDE ClassLoader MyObject.class Code 101000101 HotSwap 100010010 New  code 111000100 101010010 MyObject Saturday, April 21, 12
  • 28. JRebel Make  changes  in  IDE ClassLoader MyObject.class Code 101000101 New  code JRebel 100010010 111000100 101010010 MyObject Saturday, April 21, 12
  • 29. Hotswap  vs  JRebel JRebel&vs&HotSwap& Hotswap HotSwap( JRebel JRebel( Changing&method&bodies& +( +( Adding/removing&methods& ;& +& Adding/removing&constructors& ;& +& Adding/removing&fields& ;& +& Adding/removing&classes& ;& +& Adding/removing&annota?ons& ;& +& Replacing&superclass& ;& ;& Adding/removing&implemented& ;& ;& interfaces& Saturday, April 21, 12
  • 30. JRebel Make  changes  in  IDE ClassLoader MyObject.class Code 101000101 New  code JRebel 100010010 111000100 101010010 MyObject Saturday, April 21, 12
  • 31. JRebel Make  changes  in  IDE ClassLoader Framework MyObject.class Code 101000101 New  code JRebel 100010010 111000100 101010010 MyObject Saturday, April 21, 12
  • 32. JRebel Make  changes  in  IDE ClassLoader Framework MyObject.class Code 101000101 New  code JRebel 100010010 111000100 101010010 MyObject ConfiguraGon (XML,  annotaGons,..) Saturday, April 21, 12
  • 33. getResource(“hello.html”) read(“src/main/.../hello.html”) virtual  mapping MyApp.war Saturday, April 21, 12
  • 35. JRebel  IntegraBon hAp://zeroturnaround.com/jrebel/features/frameworks/ Saturday, April 21, 12
  • 36. What  About  Live   Environments? Saturday, April 21, 12
  • 39. • LiveRebel  updates  are – Online – Automated – TransacBonal – 100%  Reversible – Instant Saturday, April 21, 12
  • 40. ? 32 Saturday, April 21, 12