During the investigation in the scope of
MODPATBLK-90, it has been discovered that the main bottleneck of endpoint's performance is the new logic that was added in order to solve race condition problem.
After using profiler, we found out that the most time consuming operation is the database connection, as we have to read the data several times to ensure that there is no race condition.
One of the possible solutions would be using optimistic locking (folio-org/raml-module-builder: Framework allowing easy module creation based on RAML files (github.com)).
Acceptance criteria - either a design document in case optimistic locking turns out to be a good solution, or a justification why it is not.