Git Product home page Git Product logo

mongo-db-data-access's Introduction

mongo-db-data-access's People

Contributors

ffernandolima avatar ianido avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mongo-db-data-access's Issues

MongoDBContext as Singleton creates challenges for multi-tenancy scenarios

I noticed that the current implementation of services.AddMongoDbContext wires up a singleton instance of a given MongoDbContext. This assumes that one would never have a connection with a different Mongo DB database (for the likes of multi-tenancy) for the duration of the application lifetime. Is there a reason why it cannot instantiate a new instance per scoped session? (I did notice that the AsyncLocal was causing some trouble when you're invoking it at the wrong stack level and so I was forced to add a workaround of adding a dummy command to the list of commands on creation so as to retain the same list of commands throughout my request).

I have noticed that the current pattern for applying configurations for Mongo Entities is done using the ApplyConfigurationsFromAssembly method inside the MongoDbContext constructor. Since its static and not reliant on an instance of a MongoDbContext, one can place that somewhere else (like a static constructor) to be initialized only once (if performance is an issue) especially since it uses the Mongo Bson Class Mapping API.

How would you feel about changing the MongoDb Infrastructure library to cater for this concern so that I can have an out of the box experience that can cater for scenarios where I may have to connect to different Mongo DB instances during an application lifetime?

Thanks

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.