3 Side notes JAX London 2016
11th Oct – 10:00 to 10:50 Developing microservices with aggregates
- Jax Center articles about this session:
- The service boundary enforces modularization:
“2 phase commit is not an option in Micro-service solutions.”
- An aggregate of micro-services is a cluster of objects treated like a unit.
- An Aggregate has a root service and it is treated like one module of the domain model.
- Aggregate rules:
- Reference other aggregates via identity (primary key), instead of via object reference.
- One command by one aggregate. One transaction is contained within a service/aggregate.
- Atomic actions happen inside one aggregate/service.
- Consistency across aggregates is achieved via an Event Driven Architecture:
- Publish events when things happen.
- The events trigger the next step.
- Multi-step workflows.
- Event sourcing is event-centric persistence:
- Events become the first class citizens.
- Store events in persistence layer as a long history.
- Fold / Reduce the list of events to get the current state.
- Command Query Responsibility Segregation (CQRS) used to maintain views for querying.
- Audit log by definition of the solution.
- Event store solution http://eventuate.io/
- Documentation on event sourcing and Micro-services
- Documented examples here.
- Micro-services are not easy! It is fervently advised to review all the drawbacks of this new concept:
- Required to rewrite the application.
- Required considerable learning curve.
- Events evolve and change business requirements. Then a version system to work with legacy events will be required.
- Querying is challenging because it is required to maintain views for each kind of query by using CQRS.
That was all for this session. I hope it helps, please leave a comment if you would like to add something.
Posted by Marc Andreu Fernandez