Dropwizard vs Spring Boot—A Comparison Matrix
Join the DZone community and get the full member experience.Join For Free
Of late, I have been looking into Microservice containers that are available out there to help speed up the development.
Although, Microservice is a generic term however there is some consensus with respect to what it means. Hence, we may conveniently refer to the definition Microservice as an "architectural design pattern, in which complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs. These services are small, highly decoupled and focus on doing a small task."
There are several Microservice containers out there. However, in my experience I have found Dropwizard and Spring-boot to have had received more attention and they appear to be widely used compared to the rest. In my current role, I was asked create a comparison matrix between the two, so it's here below.
|What is it?||Dropwizard pulls together stable, mature libraries from the Java ecosystem into a simple, light-weight package that lets you focus on getting things done.|
|Takes an opinionated view of building production-ready Spring applications. Spring Boot favours convention over configuration and is designed to get you up and running as quickly as possible. |
|Overview?|| Dropwizard straddles the line between being a library and a framework. Provide performant, reliable implementations of everything a production-ready web application needs. |
| Spring-boot takes an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration. |
|Out of the box features?|| Dropwizard has out-of-the-box support for sophisticated configuration, application metrics, logging, operational tools, and much more, allowing you and your team to ship a production-quality web service in the shortest time possible.|
| Spring-boot provides a range of non-functional features that are common to large classes of projects (e.g. embedded servers, security, metrics, health checks, externalized configuration). |
|Libraries|| Core: Jetty, Jersey, Jackson and Matrics|
Others: Guava, Liquibase and Joda Time.
|Spring, JUnit, Logback, Guava. There are several starter POM files covering various use cases, which can be included in the POM to get started.|
|Dependency Injection?|| No built in Dependency Injection. Requires a 3rd party dependency injection framework such as Guice, CDI or Dagger.|
| Built in Dependency Injection provided by Spring Dependency Injection container. |
|Types of Services i.e. REST, SOAP|| Has some support for other types of services but primarily is designed for performant HTTP/REST LAYER. |
If ever need to integrate SOAP, there is a dropwizard bundle for building SOAP web services using JAX-WS API is provided here but it’s not official drop-wizard sub project.
| As well as supporting REST Spring-boot has support for other types of services such as JMS, Advanced Message Queuing Protocol, SOAP based Web Services to name a few. |
How it creates the Executable Jar?
| Uses Shading to build executable fat jars, where a shaded jar spackages all classes, from all jars, into a single 'uber jar'. |
| Spring-boot adopts a different approach and avoids shaded jars, as it becomes hard to see which libraries you are actually using in your application. It can also be problematic if the same filename is used in Shaded jars. Instead it uses “Nested Jar” approach where all classes from all jars do not need to be included into a single “uber jar” instead all dependent jars should be in the “lib” folder, spring loader loads them appropriately.|
|Contract First Web Services?||No built in support. Would have to refer to 3rd party library (CXF or any other JAX-WS implementation) if needed a solution for the Contract First SOAP based services.|| Contract First services support is available with the help of spring-boot-starter-ws starter application.|
|Externalised Configuration for properties and YAML||Supports both Properties and YAML||Supports both Properties and YAML|
|Concluding Remarks||If dealing with only REST micro services, drop wizard is an excellent choice.||Where Spring-boot shines is the types of services supported i.e. REST, JMS, Messaging, and Contract First Services. Not least a fully built in Dependency Injection container.|
Disclaimer: The matrix is purely based on my personal views and experiences, having tried both frameworks and is by no means an exhaustive guide. Readers are requested to do their own research before making a strategic decision between the two very formidable frameworks.
Opinions expressed by DZone contributors are their own.