Skip to content

Ensure transactional integrity / consider removal of MongoDB database #4

@davidkopp

Description

@davidkopp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions