Search code examples
scalaplayframeworklagom

What are the advantages of using Lagom over the Playframework directly?


I'm at the stage of conceiving a small JSON-based web services framework on top of Scala Play which makes really easy and suddenly stumbled upon the new Lagom framework and I'm wondering what's the added value of using it rather than the play framework directly? what would justify the extra complexity and extra footprint of Cassandra etc ...


Solution

  • Which framework is a better fit for you depends on your specific needs and requirements. When evaluating, though, you should not just consider the implementation of a single service, but of your system as a whole - e.g. how will your services communicate, how will you handle persistent storage?

    Lagom has some features that Play doesn't, such as the concept of service descriptors & service clients that simplify things such as dynamic service lookup, circuit breaker integration etc.

    As you have already discovered, it also simplifies setting up Cassandra persistence for Event Sourcing, and even asynchronous messaging between services by providing integration for a Kafka message bus. Please note that these only add to the footprint if you decide to use them.

    Play on the other hand also has features Lagom hasn't, which you may or may not need, such as rendering HTML from templates.