Spring Boot vs. JAX-RS (Restlet) for dead simple microservice [closed] Spring Boot vs. JAX-RS (Restlet) for dead simple microservice [closed] spring spring

Spring Boot vs. JAX-RS (Restlet) for dead simple microservice [closed]


They're completely different beasts and both of them can be useful to you in their own way.

I'll explain:

  • Spring Boot perfectly supports Rest services.
  • Spring Boot shines because you can create a rest service literally in 5-6 lines of code.

Spring Boot will:

  • handle web container (it has Tomcat/Jetty embedded, although you might opt for wars to be deployed externally as well)

  • Handle all the dependencies (version compliance and so force). It also means JSON manipulation framework and not just the way of declaring REST endpoints. Spring Boot uses Jackson by default.

  • Handle all the hassle of packaging everything. If you work with WAR it can be less interesting (of course, in this case you'll have to think about the web-container and Spring Boot does it for you). But you work with Jars - spring boot will create one big jar that just can be loaded with java -jar <youjar>.

  • Optionally providing a metrics and JMX stuff for your application - just declare a Maven/Gradle dependency on actuator and you're ready to go.

All this makes Spring Boot perfect for developing self-contained microservices which might be your case.

On the opposite, if you're looking for framework to provide rest on your existing solution, than probably you won't use Spring Boot. Maybe you're not using Spring at all, who knows?

So I would say, that Jersey/Restlet and so forth are just Web frameworks for easier development of REST services in Java. And Spring Boot is more about managing your application, of course it provides also a way of working with REST services just like it provides a way of working with JDBC, Servlet API and so forth.


JAX-RS is part of the Java EE specification and the standard REST API for application servers, which implement the Java EE specification. Each application server usually comes with it's own implementation, let it be RestEasy for Wildfly, Jersey, Wink etc.
It doesn't mean, that every Java framework which supports REST, has to implement JAX-RS. That said, Restlet is not a JAX-RS implementation, it's a completely independent framework (as Spring MVC with its REST capabilities is, which would be used by default by Spring Boot).

You can also develop a Spring Boot application with JAX-RS for REST, Spring Boot provides starter POMs for Jersey and also autoconfiguration to minimize your own configuration efforts.