Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure transactional integrity / consider removal of MongoDB database #4

Open
davidkopp opened this issue Oct 5, 2024 · 0 comments

Comments

@davidkopp
Copy link
Collaborator

davidkopp commented Oct 5, 2024

The modulith currently uses two databases: a PostgreSQL database and a MongoDB database. To ensure comparability, the same data structure as the microservices implementation was used when building modulith.

Using the two databases has one major drawback: There is no way to perform local transactions that span both PostgreSQL and MongoDB. For the most important operation, the completion of an order process, the monolith must access both the PostgreSQL database and the MongoDB database. One transaction would have to span both databases. This would be theoretically possible if both databases supported two-phase commits, but MongoDB does not. So the current implementation does not guarantee transactional integrity (similar problem as with the microservices system, see t2-project/microservices#2).

The best solution I can think of is to adapt the data structures and store everything in the PostgreSQL database.

Current structure:

c4-container-modulith-without-creditinstitute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant