Have a question about Lagom? We’ve sorted out a sample of frequently asked questions and provided answers below. If your question is not covered here, try these resources:
Lagom is completely open source, free to use, and has a vibrant and growing community. However, you do have the option to purchase a Lightbend subscription that provides technical support as well as license to use Lightbend Enterprise Suite, which includes a range of powerful application management, intelligent monitoring, and enterprise integration tooling.
No, Lagom supports using either Cassandra or relational databases, including MySQL, PostegreSQL, Oracle and H2. The Lagom development environment provides and uses Cassandra by default because it offers great scalability and replication features. See more in the Java documentation or the Scala documentation.
No, but it is very useful for common communication scenarios. Lagom’s Message Broker API integrates Persistent Entities with message brokers such as Apache Kafka to provide publish and subscribe messaging between services with at-least-once delivery guarantees. This enables you to design decoupled and highly-resilient systems of microservices.
If you prefer not to run a message broker, however, the Message Broker API is completely optional. You can write Lagom services that communicate with each other directly by using HTTP requests or by streaming data over a WebSocket.
The Message Broker API was designed to make it possible to integrate with alternative message broker services. Currently, Lagom only includes support for Kafka, but advanced users can write their own implementations of the Message Broker API. Future versions of Lagom might include new, officially-supported implementations.
If you are interested in official support for new message brokers, please review the open Message Broker API feature requests in GitHub. You can vote or comment on existing issues, or create new ones.
You can handle data persistence any way you like in a Lagom service, but we strongly encourage event sourcing and CQRS, and the Lagom Persistent Entity API is designed to support these patterns. For services where you do not wish to use event sourcing and CQRS, you use any data access client you choose, as long as you are careful to avoid I/O blocking the primary thread pool, which would cause performance problems and timeout errors.
Lagom provides utilities that can be used to issue non-blocking execution of database statements:
JdbcSession (Java/Scala), and
JpaSession (Java-only). Scala users might be interested in using Slick for relational database access. The Alpakka project offers Akka Streams connectors for a variety of data stores that can be conveniently used with both the Java and Scala flavors of Lagom. Many non-relational databases offer their own non-blocking, asynchronous clients, either officially or through third parties.
Yes, Lagom supports extensible serialization, both for messages transmitted between different services and for internal messages and persistent data used within a service. JSON is supported by default, as it is simple and well understood. Services that require higher performance or more compact data can use alternatives such as Protocol Buffers, Apache Avro, Kryo, or any other serializer that you choose.
Lagom doesn’t prescribe any particular production environment, however out of the box support for Lagom is provided by Lightbend ConductR. If you are interested in deploying on Kubernetes, see our guide that demonstrates how to deploy the Chirper example application.