Tagged “springboot”

  1. Java Without the JVM? A Journey into Spring Boot Native Images

    ~ cat post <<

    Java Without the JVM?

    The Cloud Bill That Didn’t Make Sense

    In the mid-2000s, Java was considered a heavyweight. A ravenous monster devouring all available hardware resources.

    Between Java 6 and Java 8, several improvements were added to Java, such as improvements to the Garbage Collector, improvements to the JIT, and improvements in memory usage.

    In Java 11, many of the historical performance concerns were significantly reduced, making it competitive with native languages in many scenarios.

    At this time deploying a Java application felt like a victory. You packaged your JAR, spun up a server, and everything worked. Memory was cheap, servers were predictable, and startup time was just a number nobody really cared about.

    Then the cloud happened.

    Suddenly, every megabyte had a price. Every second of startup time mattered. And running ten instances of your application didn’t feel like scaling—it felt like burning money.

    I remember looking at a simple Spring Boot service deployed in a container. It did almost nothing. A couple of endpoints, a database connection, some basic logic.

    And yet:

    • It consumed hundreds of megabytes of RAM
    • It took several seconds to start
    • It scaled slowly under load because of startup latency

    It didn’t feel right.

    We weren’t solving business problems anymore—we were feeding infrastructure.

    That’s when I started asking a dangerous question:

  2. Spring Boot 4: Brief Upgrade Guide and Code Comparison

    ~ cat post <<

    Spring Boot 4 vs. 3: Brief Upgrade Guide and Code Comparison

    If you’ve been following my blog, you know I love a good migration story. Whether it’s moving to TanStack Start or refining shadcn/ui forms, the goal is always the same: better developer experience and more robust code.

    Today, we’re looking at the big one. Spring Boot 4.0 is officially out, and it’s arguably the most important release since 3.0. It moves the baseline to &Java 17 (with a massive push for Java 25), adopts Jakarta EE 11, and introduces features that finally kill off years of boilerplate.

    Let’s look at exactly what changed and how your code will look before and after the upgrade.

    1. Native API Versioning

    For years, versioning an API in Spring meant custom URL paths, header filters, or complex RequestCondition hacks. Spring Boot 4 brings this into the core framework.

    The Spring Boot 3 Way (Manual Pathing)

    // You had to manually manage the path segments
    @RestController
    @RequestMapping("/api/v1/orders")
    public class OrderControllerV1 { ... }
    
    @RestController
    @RequestMapping("/api/v2/orders")
    public class OrderControllerV2 { ... }
    

    The Spring Boot 4 Way (Native Mapping)

    Now, versioning is a first-class citizen. You can keep the path clean and let Spring handle the routing logic via headers, query params, or path segments.

~ <<

See all tags .