Giter VIP home page Giter VIP logo

Comments (2)

blacktau avatar blacktau commented on May 27, 2024

I suspect the advice relates to the connection pooling in the mongo driver itself.

Issues with connection exhaustion normally only show themselves when a system is having to serve many requests at once. Registering as Scoped results in spinning up a new connection pool with every request being processed by your server. This will slow the processing of each request and if the server is taking a lot of traffic it could quickly run into re-source constraints.

As a suggestion to solve the scenario of a multi-tenant system with a database per tenant, it might be better to build and register a IMongoRepositoryFactory that creates the IMongoRepository singletons and caches the instances against some reference for each tenant. That way the problems that a scoped registration would give can be avoided.

from mongodb-generic-repository.

mkgn avatar mkgn commented on May 27, 2024

@attilabicsko - I am trying to do the same thing. Did you implement it successfully? How did you made
builder.Services.AddIdentity<ApplicationUser, ApplicationRole>()
.AddMongoDbStores<>(...) to work? Since inside this extension method it always assumes one connection strings. To me it feels like I have to change certain parts of AspNetCore.Identity.MongoDbCore as well.

Any thoughts?

from mongodb-generic-repository.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.