Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Player 2 Ready: Micronaut, a Spring Boot competitor, #DevoxxUA_2018

569 views

Published on

Microservices, Clouds, Serverless - all of this are nowadays buzz-words. It’s a trend of today’s software reality to break a monolith into microservices and deploy them to cloud. And how java developers deal with such things? With the help of Spring and Spring Boot, which become a major player, de-facto, a standard in the industry. But Spring, besides all the goodies it provides, was never designed with the Microservice approach in mind. But the most crucial thing - there are no real competitors to Spring & SpringBoot. Without good rivalry, further progress is slower (or even doubtful).
In my talk, we compare the Spring & SpringBoot with new java framework - Micronaut. We will see how less memory Micronaut can consume and how much faster is its startup time compared to a similar SpringBoot app. And also we will find out that the best practices and concepts from SpringBoot are valid citizens in Micronaut which makes a learning curve really short.

Published in: Technology
  • Be the first to comment

Player 2 Ready: Micronaut, a Spring Boot competitor, #DevoxxUA_2018

  1. 1. img src: https://wallup.net/super-mario-bros-8-bit-super-mario-2/ SUPER FRAMEWORK BROS. > PLAYER 1 > PLAYER 2 ... RDY?
  2. 2. whoami background image src: https://images7.alphacoders.com/333/333222.jpg @ipreferespresso andrew.petryk@gmail.com 2 Andrew Petryk
  3. 3. Why I THINk i know things @ipreferespresso 3
  4. 4. DISCLAIMER Everything described here is true and complete to the best of author’s knowledge. All recommendations and inferences are made without guarantee on the part of author. The author disclaim any liability in connection with the use of this information. @ipreferespresso 4
  5. 5. ? princess java Hello, %username%! I need youR help! image src: http://starsmedia.ign.com/stars/image/article/834/834987/princess-peach_420_1194999440.jpg @ipreferespresso 5
  6. 6. Please, only you can save me! I was seized and held hostage by bloody enterprise ? @ipreferespresso 6 image src: http://starsmedia.ign.com/stars/image/article/834/834987/princess-peach_420_1194999440.jpg princess java
  7. 7. The time is short! We must use microservices to get rid of that monster! ? @ipreferespresso 7 image src: http://starsmedia.ign.com/stars/image/article/834/834987/princess-peach_420_1194999440.jpg princess java
  8. 8. Maybe someone or something can help you? ? @ipreferespresso 8 image src: http://starsmedia.ign.com/stars/image/article/834/834987/princess-peach_420_1194999440.jpg princess java
  9. 9. @ipreferespresso 9 motivation why microservices?
  10. 10. @ipreferespresso Why MICROSERVICES matters? 10
  11. 11. @ipreferespresso 11 WHAT we expect from microservice? > fast startup > low memory consumption > cloud ready > easy to develop EXPECTATIONS
  12. 12. what we have ? 1 curious developer 1 Life APX 50 minutes @ipreferespresso 12IT’S about time to start our quest for java rescue
  13. 13. TO BEAT THE BLOODY ENTERPRISE princess Java @ipreferespresso 13IT’S about time to start our quest for java rescue
  14. 14. LET THE JOURNEY BEGIN @ipreferespresso 14 HARDCODE MODE ONLY!
  15. 15. our brave developer Java @ipreferespresso 15
  16. 16. Java Developer @ipreferespresso 16
  17. 17. @ipreferespresso 17 Assistance princess peach Java mentioned that someone can help us with microservices! Who could that be?
  18. 18. @ipreferespresso 18 Assistance of course! let’s use Spring!
  19. 19. image src: http://digitalspyuk.cdnds.net/16/30/480x240/landscape-1469624095-nintendo-mario.gif ..there was a time when Spring wasn’t a big thinG... but that time have changeD... @ipreferespresso 19
  20. 20. JetBrain’s 2018 State of Java Developer Ecosystem Survey image src: https://www.jetbrains.com/research/devecosystem-2018/java/ @ipreferespresso 20
  21. 21. SNYK.IO 2018 JAVA MAGAZINE JVM Survey REPORT image src: https://snyk.io/blog/jvm-ecosystem-report-2018 @ipreferespresso 21
  22. 22. Spring ?! @ipreferespresso 22
  23. 23. @ipreferespresso 23 image src: http://www.bilan.ch/entreprises/elon-musk-parler-de-lui-une-interview-dejantee
  24. 24. Less Bugs, 
 Smaller Time-to-Market, 
 Less Complexity @ipreferespresso 24 Spring Developer
  25. 25. But, hey! SOMETHING is wrong! Spring doesn’t have that fireballs! @ipreferespresso 25 Less Bugs, 
 Smaller Time-to-Market, 
 Less ComplexitySpring Developer
  26. 26. image src: https://i.kym-cdn.com/entries/icons/original/000/025/957/scoobbb.jpg revealed! that’s a Spring boot! @ipreferespresso 26
  27. 27. Embedded Server Spring ASM Environment Executable JAR SIMPLIFIED Spring Boot ANATOMY @ipreferespresso 27
  28. 28. @ipreferespresso 28 LET’S CREATE A SIMPLE SPING BOOT app image src:https://www.deviantart.com/nelde/art/Free-New-Paper-Mario-Demo-481194908
  29. 29. 29 @ipreferespresso What we get? A SIMPLE SPING BOOT app hardware: MacBook Pro 2013 Late, 2.6 GHz Intel Core i5, 16 GB 1600 MHz DDR3, SSD
  30. 30. @ipreferespresso 30 MEMORY USAGE
  31. 31. @ipreferespresso 31 Less Bugs, 
 Smaller Time-to-Market, 
 Less Complexity SpringBoot Developer
  32. 32. image src: https://imgflip.com/i/hfpcf Extreme use of Reflection Testing might be the hell of a problem relatively LONG STARTUP TIME @ipreferespresso 32 Tuning requires really deep knowledge
  33. 33. @ipreferespresso 33 OOOPS! more like Spring, But... Maybe SOMEONE ELSE can SAVE ME? Do we have an alternative to spRing boot? ? princess java
  34. 34. YES! WE HAVE! @ipreferespresso 34
  35. 35. Welcome! Player 2 - Micronaut ABOUT OCI MICRONAUT DOCS @ipreferespresso 35
  36. 36. WHY not HElidon/spark/RATPACK/vert.x ETC. @ipreferespresso 36 Has own cli/project generation Dependency Injection Supports java/groovy/kotlin FULL-STACK FRAMEWORKS
  37. 37. WHY not HElidon/spark/RATPACK/vert.x ETC. @ipreferespresso 37
  38. 38. u can download it from http://micronaut.io/download.html as binary OR @ipreferespresso 38 how to GET started
  39. 39. u can download it from http://micronaut.io/download.html as binary OR u can use @ipreferespresso 39 how to GET started
  40. 40. @ipreferespresso 40 how to GET started
  41. 41. DESIGNED TO BE COOL FROM THE VERY BEGINNING MICRONAUT was designed CONSIDERING PREVIOUS SPRING AND GRAILS EXPERIENCE, BUT ALSO with microservices AND CLOUD in mind @ipreferespresso 41
  42. 42. DESIGNED TO BE COOL REACTIVE NATURE Build on top of by default use event-loop model @ipreferespresso 42 but will switch to pre-configured I/O thread pool when blocking is needed
  43. 43. DESIGNED TO BE COOL @ipreferespressoimage src: https://www.techempower.com/benchmarks/#section=data-r17&hw=ph&test=json according to TechEmpower web framework benchmark Micronaut 
 is pretty solid in terms of 
 JSON serialization Benchmark Round 17/ 2018-10-30 43
  44. 44. DESIGNED TO BE COOL with cloud in heart @ipreferespresso 44 P.S.The list described on the slide is not exclusive or full
  45. 45. @ipreferespresso COMPETITION 45 image src: http://animated-video-games-muscular.wikia.com/wiki/Mario But Spring Boot provides all of this too, and many more. And is already production proven. What can be a game-changer? BOOT
  46. 46. @ipreferespresso 46 image src: https://giphy.com/gifs/trolli-luigi-mario-kart-8-death-stare-yc6LwDe1NmOsM LET’s FIND OUT!
  47. 47. @ipreferespresso THE PART WHERE PLAYER 2... READY? 47 and again HARDCODE MODE ONLY!
  48. 48. @ipreferespresso 48 Micronaut
  49. 49. @ipreferespresso 49 image src: https://gfycat.com/uk/gifs/detail/DeafeningAllGermanshepherd
  50. 50. @ipreferespresso 50 Micronaut Developer problems, insomnia, disturbing thoughts
  51. 51. @ipreferespresso 51 FIRST MICRONAUT APP
  52. 52. @ipreferespresso 52 FIRST MICRONAUT APP
  53. 53. FIRST MICRONAUT APP @ipreferespresso 53
  54. 54. FIRST MICRONAUT APP @ipreferespresso 54
  55. 55. FIRST MICRONAUT APP @ipreferespresso 55
  56. 56. What we get? @ipreferespresso 56 Micronaut from scratch hardware: MacBook Pro 2013 Late, 2.6 GHz Intel Core i5, 16 GB 1600 MHz DDR3, SSD
  57. 57. MEMORY USAGE @ipreferespresso 57 java: Java(TM) SE Runtime Environment (build 1.8.0_181-b13)Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
  58. 58. hardware: MacBook Pro 2013 Late, 2.6 GHz Intel Core i5, 16 GB 1600 MHz DDR3, SSD @ipreferespresso 58 What About extreme env?
  59. 59. @ipreferespresso 59 image src: https://pp.userapi.com/c841520/v841520753/6b0ce/gehIwIHd6JA.jpg
  60. 60. FIRST IMPRESSION At first, you may think that Micronaut looks something like this @ipreferespresso 60
  61. 61. FIRST IMPRESSION @ipreferespresso 61
  62. 62. IN COMPILATION WE TRUST BUT WHAT MAKES the DIFFERENCE? @ipreferespresso 62
  63. 63. IN COMPILATION WE TRUST Compile-time Dependency injection, AHEAD-OF-TIME AOP FRAMEWORK, and compile-TIME auto-configurations. @ipreferespresso 63
  64. 64. IN COMPILATION WE TRUST AnnoTATion processor AST @ipreferespresso 64
  65. 65. IN COMPILATION WE TRUST @ipreferespresso 65 SPRING MICRONAUT COMPILE RUN SCAN CLASSPATH CGLIB/Proxy COMPILE INJECT RUN/ New Instance INJECT
  66. 66. IN COMPILATION WE TRUST @ipreferespresso 66
  67. 67. Spring Interlope @ipreferespresso 67
  68. 68. SPRING INTERLOPE @ipreferespresso 68
  69. 69. MIcronaut test @ipreferespresso 69
  70. 70. @ipreferespresso 70 GRAALVM Micronaut has built-in support for GraalVM While spring boot is all about DIY and has some issues with Graal(svm) atm
  71. 71. GRAALVM @ipreferespresso 71
  72. 72. GRAALVM @ipreferespresso 72
  73. 73. right tool for the job @ipreferespresso 73
  74. 74. > Fast startup time > Easy testing > compile-time config @ipreferespresso 74 > LOW footprint WHY MN rock?
  75. 75. Spring DO HELP US TO BEAT ENTERPRISE BUT... @ipreferespresso 75
  76. 76. @ipreferespresso 76
  77. 77. MEANWHILE IN ANOTHER CASTLE @ipreferespresso 77
  78. 78. @ipreferespresso 78
  79. 79. instead of conclusion Micronaut and Spring Boot ain’t foes. They both solve the same problem - help developer to focus on Business problems and not on infrastructure. And they both do it pretty well. @ipreferespresso 79
  80. 80. @ipreferespresso 80
  81. 81. THAT’s all, FOLKS! Q&A image src:https://i.ytimg.com/vi/7RZQRt5_33k/maxresdefault.jpg @ipreferespresso 81

×