GraphQL, MongoDB on .Net Core - middleware?

Viewed 1303

I'm designing a backend app using a GraphQL, MongoDB, .Net Core stack where performance must be excellent. Wondering if given that the .net core Mongo driver supports Linq if we could just skip using a Mongoose or EFCore middle layer and just use a Repository pattern on top of the DB layer?

We're normally an EF shop so familiarity is a plus but it carries so much baggage and this app schema is fairly simple. 80% of our DB will be "sql-like" and only 20% actually requires NoSql, but due to cloud hosting costs we're going with Mongo for everything. Mongoose was suggested to me, but I'm not really seeing what I gain there.

Has anyone used this combo? Any suggestions appreciated!

1 Answers

Mongoose is different stack all together and there I am guessing you basically plan to use a another model to provide abstraction over the top of data that is being stored in the database.

https://docs.mongodb.com/realm/graphql/ => Check this out if GraphQL is what you are specifically looking for, without any big layer change.

One added layer in between your let's say .NET backend and an extra layer would extra hop BTW. (If you use another tech to just act as abstraction layer)

Related