{"id":1873,"date":"2014-12-08T10:06:40","date_gmt":"2014-12-08T16:06:40","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=1873"},"modified":"2014-12-08T15:53:04","modified_gmt":"2014-12-08T21:53:04","slug":"dropwizard-vs-spring-boot","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/1873","title":{"rendered":"Dropwizard vs Spring Boot"},"content":{"rendered":"<figure style=\"width: 161px\" class=\"wp-caption alignleft\"><img decoding=\"async\" class=\"alignleft\" title=\"The Wizard by seanmcgrath\" src=\"http:\/\/www.mooreds.com\/wordpress\/wp-content\/uploads\/2014\/12\/3248483447_95d2e9957a_m_wizard.jpg\" alt=\"wizard photo\" width=\"161\" \/><figcaption class=\"wp-caption-text\"><small>Photo by <a href=\"http:\/\/www.flickr.com\/photos\/52798669@N00\/3248483447\" target=\"_blank\">seanmcgrath<\/a> <a title=\"Attribution License\" href=\"http:\/\/creativecommons.org\/licenses\/by\/2.0\/\" target=\"_blank\" rel=\"nofollow\"><img decoding=\"async\" src=\"http:\/\/www.mooreds.com\/wordpress\/wp-content\/plugins\/wp-inject\/images\/cc.png\" alt=\"\" \/><\/a><\/small><\/figcaption><\/figure>\n<p>I just rolled off a project where I chose to use Spring Boot to create a number of microservices.\u00a0 I have also written a number of Dropwizard services, and wanted to compare the two while they were fresh in my mind.<\/p>\n<p>They have a number of similarities, of course.\u00a0 Both Spring Boot and Dropwizard create standalone jarfiles that can be deployed without needing a container.\u00a0 Both favor convention over configuration and want to help you do the right thing out of the box.\u00a0 Both are java based.\u00a0 Both have monitoring, health checks, logging and other production nicitiies buit-in.\u00a0 Both are opinionated&#8211;making a lot of choices for the developer, rather than forcing the developer to choose.\u00a0 Both make it easy to leverage existing libraries.\u00a0 Both have a focus on performance.<\/p>\n<p>However, there were a number of reasons I choose Spring Boot over Dropwizard for the recent project, and these highlight the differences.\u00a0 The first is that dependency injection is built into Spring Boot in a way that it simply isn&#8217;t with Dropwizard.\u00a0 Of course, there are <a href=\"https:\/\/github.com\/HubSpot\/dropwizard-guice\">third party solutions<\/a> for bolting DI onto Dropwizard, but we also needed a java DI framework that would handle lifecycle events, which pretty much means Spring.\u00a0 Finally, this project wasn&#8217;t all about REST services, and while Dropwizard has some support for other types of services, it really is designed as a performant HTTP\/REST layer, and certainly almost all the questions about Dropwizard online are about REST and APIs.\u00a0 Spring Boot, on the other hand, aims to provide support for a plethora of <a href=\"http:\/\/docs.spring.io\/spring-boot\/docs\/current\/reference\/htmlsingle\/#using-boot-starter-poms\">different types of services<\/a>.\u00a0 Plus, you can leverage the rest of the large Spring codebase.<\/p>\n<p>There are some other differences as well.\u00a0 Dropwizard uses <a href=\"https:\/\/dropwizard.github.io\/dropwizard\/getting-started.html#building-fat-jars\">shading to build fat jars<\/a> while Spring Boot <a href=\"http:\/\/docs.spring.io\/spring-boot\/docs\/current\/reference\/htmlsingle\/#executable-jar\">uses nested jars<\/a>.\u00a0 As far as support, Spring, as usual, wins on the documentation front, with loads of accurate docs.\u00a0 But Dropwizard definitely has a larger community around it (compare the activity of the <a href=\"https:\/\/groups.google.com\/forum\/#!forum\/dropwizard-user\">DW google group<\/a> to the <a href=\"http:\/\/forum.spring.io\/forum\/spring-projects\/boot\">Spring Boot forums<\/a>).<\/p>\n<p>If you are writing a REST API in Java, Dropwizard is a great choice (here&#8217;s a <a href=\"http:\/\/www.mooreds.com\/wordpress\/archives\/1679\">review of other options<\/a> I did a few months ago).\u00a0 If you want to build microservices that integrate with other types of components (queues, nosql, etc), Spring Boot is what I&#8217;d recommend.<\/p>\n<p><strong>Update 12\/8:<\/strong>  Per <a href=\"https:\/\/twitter.com\/phillip_webb\/status\/542072990934908928\">this tweet<\/a>, the spring forums aren&#8217;t used because of spam, but you can find plenty of support on <a href=\"http:\/\/stackoverflow.com\/tags\/spring-boot\">StackOverflow with questions tagged &#8216;spring-boot&#8217;<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just rolled off a project where I chose to use Spring Boot to create a number of microservices.\u00a0 I have also written a number of Dropwizard services, and wanted [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,5],"tags":[],"class_list":["post-1873","post","type-post","status-publish","format-standard","hentry","category-apis","category-java"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/1873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1873"}],"version-history":[{"count":4,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/1873\/revisions"}],"predecessor-version":[{"id":1900,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/1873\/revisions\/1900"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}