Moderate

Lagom, a new microservices framework

Original address: http://www.infoq.com/news/2016/03/lagom-microservices-framework 

     Lightbend, formerly known as Typesafe, has released a new open-source framework for microservices called Lagom (Swedish slang: just right). Lagom is based on the Akka responsive platform, especially for system deployment together with the Play framework, Akka series products, and ConductR. By default, Lagom is message-driven and asynchronous, and uses distributed Command Query Responsibility Segregation (CQRS) and event-sourced patterns as the main implementation.

     Jonas Bonér, CTO of Lightbend and founder of Akka project, one of the reasons why Typesafe was renamed Lagom is to emphasize the "micro" concept of microservices, and "micro" emphasizes just right (Lagom) Service granularity, not just how small the microservice system is.  

 

Speaking with InfoQ's Bonér, he mentioned his thoughts on the new framework Lagom: 

 

InfoQ: What do you think are the main features of Lagom? 
Jonas Bonér: I think Lagom is unique compared to other microservice frameworks in the following points: 

• Most microservice frameworks focus on simplifying the construction of individual microservices, which of course is easy to do. Lagom extends to the system level of microservices, and it is a large system, which requires solving complex distributed problems, which is the most difficult part

• By default, Lagom communicates asynchronously, but if you need to use other protocols, such as synchronous REST requests, the communication needs to be stream-based

• By default, data persistence is based on event source-driven mode, but if you need to support JPA or NoSQL databases, you need CQRS mode (is to separate commands (commands that change data) and queries (read data). Read-write separation.)

• A fully integrated development environment with hundreds of microservices managed with just one command. It supports automatic hot code reloading across all services and integration with IDEs and other tools. The development environment is based on the production environment (via ConductR), which directly supports deployment and scale-up in production.

 

InfoQ: Is Lagom a bootstrapping framework?  

 

Bonér: Yes, it's a bootstrap framework, we have a lot of experience with the Akka project and the Play framework, and our users have also used our platform to build microservices projects for many years, even before the word microservices came around for them already in use. 

Lagom is based on reactive principles (as defined in the Reactive Manifesto), which makes a lot of sense. The set is Responsive, Resilient, Elastic and Message Driven. The system is called Reactive Systems. The design of Lagom follows the concept of reactive systems. Lagom's goal is to make it easy for users to do things by taking it over, and provides a guardrail approach, with default values ​​set. You can also ignore Lagom and focus on your own business. 

 

InfoQ: More specifically, what does Lagom advocate and encourage?  

 

Bonér: We just touched Lagom briefly, now I'll go into detail. Some of the key principles that make Lagom easy to use are: 

 

1. The real isolation design is not shared with each other, which means that each service of Lagom is independent, loosely coupled, and fluid (the location is transparent), which is also the system with resilience and scalability (elasticity) necessarily requires. Lagom's microservices are based on: 

◦Akka Actors-Isolation is implemented according to the Actor model of a shared-nothing architecture

◦Akka Cluster - A set of instances of a single service with resilient, sharding, master-slave replication, scalability, and load balancing constitute a microservice

◦ConductR-Provides security isolation for the underlying implementation of microservices and the operation and management of instances

 

2. Single Responsibility: A classic rule: a class has only one responsibility and do it well, it was mentioned decades ago in Unix principles. This also helps many developers write single-responsibility programs, writing small and well-defined classes that can be perfectly combined with other programs. When it comes to microservices you think about the size and the length of the code, too bad. Lagom simplifies design by reducing template code so you can focus more on your own development services. It's easy to create a well-typed composite protocol, whether via asynchronous messages or request/response or a continuous stream.

3. Whoever owns the data will serve (whoever owns the data will be responsible): Each service requires not only behavior but also data, down to data persistence. Lagom's default persistence model is event source and CQRS, using Akka project and Cassandra persistence, which is scalable, easy to implement master-slave replication, and fully elastic. As a bonus, Lagom is also very convenient to check and debug, and it can reproduce or inspect the event log with breakpoints in time. It also avoids the mismatch of traditional object associations, such as ORM technologies such as JPA and Hibernate. One of the benefits of being able to freely choose persistence model microservices, especially for solving the problem at hand, is called Polyglot Persistence

 

 

4. Asynchronous implementation: Lagom's communication and IO are asynchronous and non-blocking by default, which is also the basis of responsive system design. This makes sense: greater cost-effectiveness is achieved by utilizing efficient resources; it helps to minimize competition for shared resources in the system, which is the biggest obstacle to achieving scalability, low latency, and high throughput in the system; Asynchronous non-blocking also plays a big role in dynamically creating resilient loosely coupled systems. Microservice-based systems need to face and accept the challenges posed by real-world systems.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326991309&siteId=291194637