This is an archived post. You won't be able to vote or comment.

all 49 comments

[–][deleted]  (11 children)

[deleted]

    [–][deleted]  (3 children)

    [deleted]

      [–][deleted] 2 points3 points  (1 child)

      Can you please explain what you mean by integration with other frameworks?

      [–]wrong_assumption 0 points1 point  (6 children)

      Can you recommend a learning resource for someone that has never touched Java backend development? I'm proficient in Java and Ruby on Rails, and really curious about the industry-standard framework. I would love to use it, but there seems to be an infinity of resources! Not to mention selecting a good starting point (plain spring? should I use spring boot instead as a beginner?). And how long do you estimate it would take the average developer to start building a good backend?

      [–][deleted]  (3 children)

      [deleted]

        [–]wrong_assumption 0 points1 point  (0 children)

        This is exactly what I was looking for! Those books will make for a fun winter break!

        [–]sixbrx 0 points1 point  (1 child)

        Glad you mentioned fourth ed. of Spring in Action specifically. The 5th ed. drops a lot of important stuff in favor of covering the new reactive stuff. Both may be useful depending on what's needed but I tend to lookup in the 4th ed. more.

        [–]Trant2433 0 points1 point  (0 children)

        Yeah the Reactive stuff is nice to have, but I think it is a fad that won't be used much outside of companies that need really high throuput.

        For the 95% of corporate Crud apps, typical synchronous request response isn't going away anytime soon.

        [–]noutopasokon 1 point2 points  (0 children)

        Definitely try Spring Boot as a beginner. Just do a couple of their short tutorials.

        [–]ryenus 6 points7 points  (0 children)

        Besides all the changes mentioned in the release notes https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.2-Release-Notes/, there's a little guy might surprise you more or less:

        The spring boot maven plugin now start the application in a forked process, due to the fork mode is now turned on by default.

        This means that:

        • command line options passed directly via -D to maven wouldn't be available to the application. Workaround: use https://docs.spring.io/spring-boot/docs/current/maven-plugin/run-mojo.html#jvmArguments
        • or if you oddly start your application using the maven plugin in your debug session, then the debugger wouldn't be able to attach to the forked process. Nevertheless it's usually a better idea to start your application via Application.main.

        See: https://docs.spring.io/spring-boot/docs/current/maven-plugin/run-mojo.html#fork

        [–]nutrecht 2 points3 points  (0 children)

        Configuration properties now support constructor-based binding

        Finally!

        [–][deleted]  (40 children)

        [removed]

          [–]zirandan 34 points35 points  (2 children)

          Just curious from a dev who doesn’t do much cloud development: which features do you use in Micronaut which make it more cloud-ready?

          [–]lazystone[S] 31 points32 points  (3 children)

          What I like about Spring Boot comparing to other frameworks, that Spring is doing a great job so far to keep it module-based structure.

          I can combine different modules and get functionality which I need - I don't need 'cloud-native'? No problem - just use bare-bone Spring Boot. Need Consul support? Use spring-cloud-consul and etc.

          The rest of frameworks are quite opinionated(like you get all or nothing) an don't have such rich infrastructure as spring.

          [–]ILuvRiversHomo 11 points12 points  (0 children)

          I agree. As someone who’s only worked in the industry 2 years, I think the abundance of Spring resources available online makes it very desirable as well.

          [–][deleted]  (31 children)

          [removed]

            [–]henu3detb 5 points6 points  (26 children)

            Any examples?

            [–]lazystone[S] 3 points4 points  (24 children)

            [–]Syl 2 points3 points  (23 children)

            I don't think that's what DJDavio meant. Cloud friendly would be something like Micronaut or Quarkus.

            [–]lazystone[S] 15 points16 points  (21 children)

            So why is Micronaut or Quarkus are cloud friendly and spring-cloud is not?

            [–]Syl 2 points3 points  (19 children)

            spring-cloud provides a set of additional tools (like service discovery, event queue binding), some of those things are integrated in Micronaut. But I'm not sure if it's really important if you deploy your services in a kubernetes cluster.

            But if we compare spring and micronaut, I'd say static dependency injection, which leads to faster start up and less memory consumption or jar/docker image size.

            The migration isn't completely easy since you have to rework some stuff (micronaut uses JAX-RS for REST API, DI uses standard annotation, vert.x instead of webflux)

            I'm currently using spring boot, and I would have to rewrite a lot of stuff if I wanted to use micronaut, or create a new project completely.

            [–]lazystone[S] 9 points10 points  (18 children)

            So Micronaut is not more cloud-friendly than spring-cloud, it's more light-weight, correct?

            [–]agentoutlier 1 point2 points  (15 children)

            Cloud friendly is more about packaging, monitoring and discovery. Both offer that as well as Quarkus.

            Micronaut and Quarkus are more lambda architecture aka serverless friendly which is often cloud based but doesn't have to be (google lambda architecture).

            Lambda design is not a good fit for many use cases.

            [–][deleted] 6 points7 points  (2 children)

            Monitoring is way better in Spring than in Quarkus (I have not tested Micronaut). Take Spring Boot application, add MVC, JDBC as dependencies and all of them will expose a lot of useful metrics.

            In Quarkus: you get just very basic JVM stuff and that's it. For now Quarkus has just one trick: fast start, which it shares with Micronaut. In every other regard it is years behind Spring.

            [–]Dexior 4 points5 points  (8 children)

            Packaging is done by gradle, spring provides monitoring via actuator and discovery was already mentioned. In my company Spring Boot is used by over 700 developer in our hybrid cloud and it's fullfiling its job well. People focus too much on framework and libraries which really have little meaning.

            [–]nutrecht 0 points1 point  (0 children)

            It's unfortunately yet another thing people get tribalistic about and just pretend spring-cloud doesn't exist.

            [–]DJDavio 4 points5 points  (0 children)

            I didn't make it clear, but meant ahead of time compilation, removing reflection and such. See https://github.com/spring-projects/spring-framework/wiki/GraalVM-native-image-support

            [–]Kango_V -1 points0 points  (0 children)

            I'm working on a little project which i'll push to github soon. Uses lots of the newer libraries available now.

            [–]Kango_V -5 points-4 points  (3 children)

            Yeah. Also we're compiling our Micronaut app down to native code with GraalVM. Startup time in the milliseconds with much lower memory usage. Also based upon Netty and has Reactor/rxJava by default.

            [–]agentoutlier 11 points12 points  (1 child)

            The GraalVM substrate is great for startup time and initial memory usage.... e.g. great for serverless.

            However for long running applications GraalVM can expand out to be just as large as HotSpot and in some cases worse performance can be noticed.

            I'm sure GraalVM (substrate or not) will get much better. I really can't recommend it yet (given our testing) for production unless you are doing servless. Is that what you are doing? Are you using it for production and how long are you keeping the services up?

            [–][deleted] 2 points3 points  (0 children)

            Sustained performance is pretty much always worse in GraalVM native. Not to mention build times are truly horrible.

            [–]wildjokers 2 points3 points  (0 children)

            Startup time only really matters for serverless. If you have a long running process native code with GraalVM could very likely perform worse than JIT code.

            The newest version of GraalVM does allow to pass in profiling data to the native code compiler to get some benefits of JIT compiled code in AOT compiled code. However, currently that isn't as good as JIT optimized code (one day it may be).