Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Piranha Cloud - From Eclipse GlassFish to super...

Piranha Cloud - From Eclipse GlassFish to super fast Cloud and Serverless Java

Eclipse GlassFish means stability and tradition, while Piranha Cloud is a next generation cloud-native Jakarta EE runtime built for extreme speed, short cold starts and developers’ joy. Wanna see Jakarta EE boot under 100 milliseconds? Wanna understand how that's possible and what’s the role of GlassFish in it? Then come to this talk.

Is Eclipse GlassFish server dead? Not at all! Quite the contrary,it’s gone a long path since Oracle dropped commercial support for it and it’s being actively developed now by OmniFish and other companies. It’s now heading towards Jakarta EE 10, with many fixed bugs and performance improvements. But it still has a lot to catch up to match cloud and serverless requirements. And that’s exactly where Piranha Cloud shines. Built on some of the best GlassFish components, assembled from the bottom to provide only what’s necessary. Do you wonder how’s that possible? We’ll first review the current status of GlassFish, how Piranha happened and then show both in action. You'll see for yourself how fast and powerful modern Jakarta EE runtimes can be nowadays!

Source code repository for the demo applications: https://github.com/OmniFish-EE/Presentation-Piranha-from-GlassFish#readme

References:
* Eclipse GlassFish: https://glassfish.org/
* Spring Boot: https://spring.io/projects/spring-boot
* Piranha Cloud: https://piranha.cloud/
* AWS Lambda: https://aws.amazon.com/lambda/

OmniFish Presentations

October 08, 2022
Tweet

More Decks by OmniFish Presentations

Other Decks in Programming

Transcript

  1. Ondro Mihályi @OmniFishEE Application servers Designed for reliability and security

    Provide a lot of robust features Designed for management during runtime Designed to run for a long time (and restart rarely)
  2. Ondro Mihályi @OmniFishEE Java startup time Plain Java starts fast

    In milliseconds, way faster than application servers
  3. Ondro Mihályi @OmniFishEE What is Jakarta EE (formerly Java EE)

    Just an API Common API provided by many servers Collection of smaller APIs Boot time an implementation detail
  4. Ondro Mihályi @OmniFishEE API versus implementation Learn and use a

    single API Choose from multiple implementations
  5. Ondro Mihályi @OmniFishEE History of GlassFish 2006-2012 – supported by

    Sun MS, later Oracle 2013-2017 – maintained by Oracle, no support 2018-now – maintained within the Eclipse Foundation • supported by multiple companies 2022 – Eclipse GlassFish 7 provides Jakarta EE 10
  6. Ondro Mihályi @OmniFishEE The current status of GlassFish Jakarta EE

    10 Java 11 to 18 MicroProfile Config Jakarta MVC Embedded GlassFish Lots of fixes and new tests
  7. Ondro Mihályi @OmniFishEE GlassFish Embedded Start from a Java app

    GlassFishRuntime.bootstrap() .newGlassFish().start(); Faster startup Simple Flexible
  8. Ondro Mihályi @OmniFishEE Built on well‑known projects GlassFish is modular

    Jersey (REST) Eclipselink (JPA) Tyrus (WebSockets) Weld (CDI) Exousia (Authorization) Eleos (Authentication) Expressly (EL) Transact (JTA) WaSP (JSP) More modules extracted
  9. Ondro Mihályi @OmniFishEE Piranha Cloud Introducing Piranha Cloud Exousia (Authorization)

    Eleos (Authentication) Expressly (EL) Transact (JTA) WaSP (JSP) Jersey (REST) Eclipselink (JPA) Weld (CDI)
  10. Ondro Mihályi @OmniFishEE Architecture of Piranha Cloud Bare‑bone Servlet container

    Jakarta EE profiles Extensions to add features Servlets to add features
  11. Ondro Mihályi @OmniFishEE Piranha Cloud extensions Jakarta EE Pluggable functionality

    Extension groups From GlassFish and other projects Hazelcast, third-party extensions More extensions in a single one
  12. Ondro Mihályi @OmniFishEE Piranha Cloud distributions Executable JARs Package multiple

    extensions Embed HTTP server Run from command line Coreprofile Webprofile Piranha Server
  13. Ondro Mihályi @OmniFishEE Embedded Piranha var piranha = new EmbeddedPiranhaBuilder()

    .servletMapped(MyServlet.class, "/") .build(); piranha.start(); var httpProc = new HttpWebApplicationServerProcessor(piranha); var httpServer = new DefaultHttpServer(8080, httpProc, false); httpServer.start();
  14. Ondro Mihályi @OmniFishEE Embedded Piranha without HTTP listener var piranha

    = new EmbeddedPiranhaBuilder() .servletMapped(MyServlet.class, "/") .build(); piranha.start(); var request = new EmbeddedRequestBuilder().build(); var response = piranha.service(request); System.out.println(response.getResponseAsString());
  15. Ondro Mihályi @OmniFishEE Piranha Server architecture Piranha Server HTTP listener

    Embedded Piranha App 1 Embedded Piranha App 2 Embedded Piranha App 3 /app1 /app3 /app2
  16. Ondro Mihályi @OmniFishEE Where startup speed matters? Serverless Minimize cold

    starts Remove what’s useless Optimize what’s left
  17. Ondro Mihályi @OmniFishEE Piranha in AWS Lambda No HTTP listener

    Init in static block Starts fast Custom Java 17 layer (for now)
  18. Ondro Mihályi @OmniFishEE Comparison of startup times – close up

    (Simple app with a single Jakarta EE Servlet)
  19. Ondro Mihályi @OmniFishEE Conclusion? Same Jakarta EE APIs, implementations differ

    GlassFish has improved Jakarta EE not slow, servers are slow Piranha goes where GlassFish can’t get
  20. Ondro Mihályi @OmniFishEE OmniFish - Jakarta EE Consulting & Support

    Jakarta EE Consultancy (migrations, tuning) Jakarta EE Application Development GlassFish Server Support omnifish.ee Jakarta EE Training