Micro-services with Dropwizard

Micro-services with Dropwizard

Micro-services are a pattern for building small, single responsibility services that can be independently deployed and orchestrated as part of a larger services oriented architecture. Dropwizard is a Java framework for building RESTful webservices that are high-performance and developer friendly. It is mostly glue around stable and best-of-breed java libraries like Jersey, Jetty, and Jackson. We will talk about how Dropwizard addresses configuration, metrics, and logging.

E655ab825a4bd2f23b90c85d57c3ee01?s=128

Kyle Boon

March 27, 2014
Tweet

Transcript

  1. 8.

    Independance on various axes Select implementation and storage technology Test

    Deploy to production Recover from failure Monitor Horizontally scale Replace http://literateprogrammer.blogspot.com/2014/03/the-microservice-declaration-of.html
  2. 11.

    The stack at BloomHealth Groovy for programming Grails for web

    applications Dropwizard for JSON web services Gradle for builds Swagger for Service Discovery Spock for testing Gatling for Performace/Load Testing Redis for Caching RabbitMQ for messaging
  3. 12.

    What is Dropwizard Dropwizard is a heavily opinionated framework for

    building web services on the JVM. It is mostly glue around mature java libraries like Jetty, Jersey, Jackson and Guava. 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 HTTP+JSON web service in the shortest time possible.
  4. 13.

    Who Created it? @coda As I've said before, the only

    reason Dropwizard exists at all is to provide opinions on what a service should be. I think they work better.It embeds Jetty because I think that works better.It uses Jackson because I think that works better.It uses Jersey because I think that works better.It has a single YAML configuration file because I think that works better. It wraps Logback because I think that works better.
  5. 14.
  6. 15.

    User dropwizard if you want get stuff done; don't use

    dropwizard if you want to shave yaks
  7. 16.

    The Application Services are a collection of bundles, commands, healthchecks,

    tasks and resources. The service class defines all of the abilities of your application.
  8. 17.

    The Resource Resources model what is exposed via your RESTful

    API. Dropwizard uses Jersey for this so these classes are mostly jersey annotations.
  9. 18.

    The Representation Your POJOs will be turned into JSON via

    Jackson. Hibernate Validator lets you specify validation rules.
  10. 19.

    Bundles Bundles are reusable blocks of behaviour designed to be

    reused across services. Assets, Hibernate and Liquibase are all implemented as Dropwizard Bundles.
  11. 20.

    Commands Commands add options to the command line interface of

    your service. For example the server starts based on the 'server' command. Migrations run based on the 'db migrate' command. You might add your own command for running functional tests or seeding the database.
  12. 21.

    Tasks Tasks are run time actions available over the administration

    port. Dropwizard ships with a garbage collection task. You might want to right a task to clean a cache by key.
  13. 23.

    References - Microservices Martin Fowler on Micro-services Less micro more

    service What are micorservices? Presentation: Micro-services the Unix way Microservice declaration of independence
  14. 24.

    References - Dropwizard Dropwizard User Guide Dropwizard User Group https://github.com/codahale/dropwizard

    Presentation about Dropwizard @ Yammer Presentation about Dropwizard @ Simple Coda Hale and Metrics Coda Hale and the Programming Ape