Our team is trying to architect a graphql API using prisma cloud as our database, but we are a bit stuck on how best to architect it. We would like to follow a microservices-based architecture where business logic is delegated to these services which can function on their own-- the share-nothing philosophy. One way we thought of accomplishing this is by splitting up our application into services which have their own prisma databases and stitching them together (i.e. a user service, payments service, etc.). Essentially this pattern:
However, we run into the issue of nested filters. For instance, if we want to get all users where their payment method is a credit card, we wouldn’t really be able to do that since users may only reference paymentId and vice versa. The alternative is to centralize the database (a single prisma schema) and share it among the different microservices.
We are mainly looking for advice on how best to approach this.