Play 2.4.X : Microservice Architecture using Play and Scala

Playing-Microservices

This blog describes a basic Microservice architecture design using Play 2.4.X and Scala. The big idea behind microservices is to architect large, complex and long-lived applications as a set of cohesive services that evolve over time. The term microservices strongly suggests that the services should be small.

In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.

Single node microservice architecture

microservices-arch

Multiple node microservice architecture with load balancer

microservices-arch-with-elb

Dive into code level activities

Scalastyle : Check the code quality

To check code quality of all the modules

$ ./activator clean compile scalastyle

Scoverage : Check code coverage of test cases

To check code coverage of test cases for all modules

$ ./activator clean coverage test

By default, scoverage will generate reports for each project seperately. You can merge them into an aggregated report by invoking

$ ./activator coverageAggregate

Deployment : microservices

$ ./activator "project <service-name>" "run <PORT>"

References


6 thoughts on “Play 2.4.X : Microservice Architecture using Play and Scala

  1. Wouldn’t it be better if each microservice had its own database, so each service owns its data.
    Microservices split one large application into small independent parts, this should also apply to the database.

Comments are closed.

Knoldus Pune Careers - Hiring Freshers

Get a head start on your career at Knoldus. Join us!

%d bloggers like this: