Background
I have recently joined a relatively new project to replace an old system that stuggles under high load and has become difficult to maintain.
This new system has failed to satisfy any of its goals so far. Sure, it is using modern technologies, is deployed to AWS, is no longer using Access (!!!) as the database and instead uses RDS.
Also it is no longer a monolith and it has been divided into a few smaller services.
However it is still not performant enough and it continues to be a stuggle to develop and maintain (many methods and classes have many nested if/else statements, nested for loops, and so on to the point that their cyclomatic complexity is through the roof and raises all kinds of alarms on our CI/CD pipeline).
In the old days, when SOAP and WS-* was all the hype, I had read a few articles about BPMN and jBPM here and there but in practice I don’t know what problem they actually solve and how they do it and I was wondering if employing it could mitigate some of our problems?
Yesterday I watched a course about the Drools rule engine and I am 100% sure that it can make our validation system much more easy to understand and eliminate many of our issues with cyclomatic complexity and maintainance. However I still don’t know if and how jBPM and BPMN can help us improve the design, implementation, and maintainability of our system further.
Overview of the system
The system is not actually for airline ticketing but is very similar. For confidentially/IP obligations I can’t discuss it in public so let’s assume it is an airline ticketing system.
We have 2 categories of external parties: 1) Travel Agencies and 2) Airlines.
A travel agency submits a booking request to one of our services in a prehistroic binary format that’s a pain to work with and our service parses and converts it into well structured JSON documents. Let’s call this service “Decoding Service”.
The Decoding Service forwards the request to our core system, the “Ticketing Service”. This service performs a plethora of validation rules on the request. If the request was valid it returns a 200
success message back to the “Decoding Service” which will pass it on to the agency, letting them know that we have successfuly received and validated their request.
A scheduler will eventually grab the booking request, perform a host of other validations on the request, find the relevant airline and forward a modified version of the request to the airline. The airline may respond with 200 (request received) or 400 (bad request). If we get 400 back, we will mark the booking request as failed in the databse. If we get 200 back, we mark it as “waiting for response from airline”.
Assuming we get 200 back, the airline will eventually send another request back to us that contains the result of processing our booking request. Even this result might indicate that the booking has failed.
Another scheduler will eventually pick this result up from the database, performs some validations to make sure it doesn’t contain any information that conflicts with the actual/original booking request that was made by the travel agency. If everything looks good, the response is sent to travel agency.
The system is much more complex. For example the airline might contain some information in the booking result that indicates that the customer is eligible for some sort of bonus (e.g. Sky Miles). If this happens, and the customer at the travel agency decides to use the bonus, another cycle of request/response messages will occur.
Would incorporating jBPM into our “Ticketing Service” provide us with any benefits?
So far I have decided to migrate our validation rules to Drools.
But would adding jBPM to our system help us improve it even further? If yes, how?
ّFYI, or services are built using Spring Boot and our API uses JSON over HTTP for communication (probably maturity level 1 RESTful).
Thanks in advance.
submitted by /u/Algorithmopolus
[link] [comments]