WHAT'S IN A NAME?

Microservices and Lagom

Why Microservices?

What is a Microservice?

Isolated

Asynchronous

Autonomous

Single Responsibility

Exclusive State

Mobility

Wait a minute...

There are only two hard problems in computer science: cache invalidation and naming things
- Phil Karlton

Monad

AbstractSingletonProxyFactoryBean

Object-Oriented Programming

How big should a microservice be?

As small as possible & as big as necessary

Lagom

Lagom
1. Swedish: enough, sufficient, just right.
2. A new opinionated microservices framework from Lightbend

Disclaimer

Lagom is an early release (M1) product. There will be updates and changes between now and final 1.0.0 release. Do not use in production. Do not taunt Lagom. Documentation for Lagom is still a work in progress.

Demo

So, how did we do?

Isolated?

  • Services are broken out in individual projects.
  • Seperate projects for API and implementation
  • Short-circuiting implemented by default

Asynchronous

  • All service APIs are implemented as ServiceCall<Id, Request, Response>
  • invoke() method responds with CompletionStage<Response>
  • Making it block requires additional effort!

Autonomous

  • Independent sbt builds
  • Allows for integration with external Lagom projects:
    
    lazy val helloworld = lagomExternalProject("helloworld",
      "sample.helloworld" %% "helloworld-impl" % "1.0")
                                    
  • Does not require Lagom for external services

Single Responsibility

  • OK, this one is really on the developers

Exclusive State

  • Provides Cassandra integration out of the box.
  • ES/CQRS integration requires interfacing through the API

Mobility

  • Utilizes Akka actors/clustering
  • Current supported deployment environment is ConductR
  • I expect the community will quickly implement other deployments

For more information: