Slide 1

Slide 1 text

Micro-services with Dropwizard Kyle Boon

Slide 2

Slide 2 text

Kyle Boon Team Lead @ Bloomhealth [email protected] @kyleboon http://www.kyleboon.org

Slide 3

Slide 3 text

Architecture 2011

Slide 4

Slide 4 text

Architecture 2012

Slide 5

Slide 5 text

Architecture 2013

Slide 6

Slide 6 text

Micro-service architecture is the composition an application by multiple component services.

Slide 7

Slide 7 text

Micro-services are about single- responsibility and bounded countexts

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Conway's Law implies that micro-services lead to small independent teams

Slide 10

Slide 10 text

Frameworks for micro-services Dropwizard Ratpack Spring Boot Finegle Scalatra Sinatra Flask

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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.

Slide 13

Slide 13 text

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.

Slide 14

Slide 14 text

It's fast

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

The Application Services are a collection of bundles, commands, healthchecks, tasks and resources. The service class defines all of the abilities of your application.

Slide 17

Slide 17 text

The Resource Resources model what is exposed via your RESTful API. Dropwizard uses Jersey for this so these classes are mostly jersey annotations.

Slide 18

Slide 18 text

The Representation Your POJOs will be turned into JSON via Jackson. Hibernate Validator lets you specify validation rules.

Slide 19

Slide 19 text

Bundles Bundles are reusable blocks of behaviour designed to be reused across services. Assets, Hibernate and Liquibase are all implemented as Dropwizard Bundles.

Slide 20

Slide 20 text

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.

Slide 21

Slide 21 text

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.

Slide 22

Slide 22 text

Other Stuff Configuration Logging Hibernate/JDBI Clients Authentication Views

Slide 23

Slide 23 text

References - Microservices Martin Fowler on Micro-services Less micro more service What are micorservices? Presentation: Micro-services the Unix way Microservice declaration of independence

Slide 24

Slide 24 text

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