Would either nhibernate or entity-framework be able to support 1000's of databases?
Scenerio: This would be a Saas application, *where each client gets their own seperate databas*e. So 10K clients, would mean 10K databases (their domain would map the to a specific db).
Could nhibernate support such a design requirement?
How about entity-framework?
I would imagine the connection string would be modified during the begin_request for that specific customer, based on their own domain name which would map them to their specific db.
Note Please don't tell me this is a poor design choice, just take it as a requi开发者_JAVA技巧rement.
Supporting mysql would also be an added benefit, which I know nhibernate does but not sure about EF
NHibernate can handle this, you'll need a session factory for each database.
Every session factory would have a different name/id, everytime you connect to a database, you should get the nHibernate session from the right session factory.
Also, build session factories is an expensive process, so you should cache them. SharpArch can help you with multiples session factories and cached session factories.
精彩评论