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

Bootique.io: a faster, simpler Java platform

Avatar for Andrus Adamchik Andrus Adamchik
December 23, 2024
10

Bootique.io: a faster, simpler Java platform

In our choice of application platforms in the Java community, we seem to be ready to sacrifice elegance for convenience and are content with slow startup times, bloated jars and “magical” annotations. The Bootique project (https://bootique.io) strives to push the envelope against this trend, and give both elegance and convenience. It is a faster, simpler, lightweight app platform with a minimal “weirdness factor”, and yet with rich functionality including dependency injection, interoperable modules, centralized configuration, built-in CLI and more.

Bootique can be used for all kinds of apps: web services, scheduled jobs, DB migrations, serverless, command line tools, etc. This presentation will show how all these pieces fit together and will do some SpringBoot comparisons.

Avatar for Andrus Adamchik

Andrus Adamchik

December 23, 2024
Tweet

Transcript

  1. ... surprises everywhere 🙃 • Code magic: forget APIs, learn

    annotations • Classpath magic: inadvertently activating features • Build magic: without SB “dependency management”, transitive dependencies are all wrong • Con fi g magic: myriad meshed together con fi g options • ... and yes, slow startups
  2. An engine that: 1. loads object creation "recipes" from Modules

    2. loads con fi guration 3. creates objects in a shared "space" (BQRuntime) 4. executes a command What does Bootique do?
  3. "Magic" lives in modules (and in tests), everything else is

    navigable via API 70% less magic ... and fairly little boilerplate
  4. Discover modules An explicit hint avoids the performance penalty of

    a full classpath scan META-INF/services/io.bootique.BQModule
  5. CLI causes and effects $ java -jar my.jar --server io.bootique.jetty.command.ServerCommand

    POSIX CLI is nice as is, but also directly linked to "command" classes
  6. Performance - Startup Time Bootique SpringBoot time 1.3s MacBook Pro

    2021 M1, 16GB RAM, OpenJDK Temurin-21, https://github.com/andrus/di-comparison 0.7s 0.74s 0.16s empty app REST app (BQ,Jetty,Jersey vs SB,Jetty,spring-web)
  7. Performance - Jar Size Bootique SpringBoot file size 19.6MB MacBook

    Pro 2021 M1, 16GB RAM, OpenJDK Temurin-21, https://github.com/andrus/di-comparison 11.6MB 9.9MB 2.8MB empty app REST app (BQ,Jetty,Jersey vs SB,Jetty,spring-web)
  8. Performance - Memory Use Bootique SpringBoot heap size 12MB MacBook

    Pro 2021 M1, 16GB RAM, OpenJDK Temurin-21, https://github.com/andrus/di-comparison 8.5MB 6MB 1.5MB empty app REST app (BQ,Jetty,Jersey vs SB,Jetty,spring-web)