Dynamic programming (DP) is a technique used to solve innately inefficient recursive problems by storing solutions to pre-computed subproblems. The idea is to break a problem into smaller subproblems and save the result of each subproblem so that it is only calculated once. Dynamic programming involves two parts: restating the problem in terms of overlapping subproblems and saving the solution of the subproblems so that we can build the solution to the bigger problem.
Distribution transactions or any situation where a single event results in the changes of two or more separate data sources which cannot be committed atomically are the well known problematic part of distributed applications. Let's take a look how to approach it.