'spring boot transactional integration for event management
We have recently put a REST Spring Boot MVC application into production. We are using JPA with Postgresql in order to achieve some nonfunctional requirements: we need a Recovery Point Objective (RPO) of 0, and a short Recovery Time Objective (RTO). Our context also requires atomicity and consistency in the execution of business services, as provided by a relational RDBMS. Postgresql provides all that for us, and is one of the databases in the portfolio of our customer.
The application has an important part of processing which is done asynchronously. For that part, we have developed a custom event and batch module that integrates into the JPA - Postgresql ecosystem. Moreover, the use of a unique database transaction for job/event management and business logic provides a simple, consistent, and robust architecture over which we can develop application business logic.
This pattern in which we use the same transaction for both event management and business logic applies to the following use cases:
- A given business service may generate some events. In this situation, it is important to us the consistency and atomicity between the corresponding changes to the business model made by the business service and the registration of events.
- The asynchronous execution of an event might trigger/execute a business service. In this situation, we also need atomicity and consistency of the side effects of this business service into the persistent data model, and the management of the execution of the triggering event.
This provides us a simple and sound model, with the desired RPO and RTO properties.
We would like to evolve from our custom model to a model based on a sound and stable opensource solution for event management which keeps atomicity, consistency, and RPO and RTO as demanded. In this sense we are analyzing the use of Spring Batch in this scenario. Would Spring Batch be suitable for our scenario, in which , apart from job execution, we do have some intensive event-execution peaks?
Any other opensource product which would integrate seamlessly in our Spring Boot ecosystem?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|