Is Nhibernate Shards Production Ready?

I work for the company, we have a single database scheme, but each of our clients uses its own dedicated database with one central database, which stores the contact information of the client and which database is used by the client, so we can connect to the corresponding database data, I looked at using NHibernate Shards, but it seems to be very quiet and does not look complete.

Does anyone know the status of this project? Has anyone used it in production?

If this is not yet at a point that is considered usable, what are the alternatives? The two main ones are:

  • Create a factory session for each database and then a wrapper to select the appropriate factory to generate the correct session - it seems to me that I have redundant session factories and are not too efficient
  • Create only one factory session, but when calling opensession, skip its IDbConnection, which allows the session to have a different database connection.

My concern with respect to 2 is how NHibernate will handle the second level cache, as I believe it is controlled by the factory session - also the HiLo generator uses the factory session, I believe. In these cases, do sessions involving different dbs cause problems? For example, we end with the class MyCompany.Model.User, which has an identifier of 2 in both databases, will this cause conflicts in the cache?

+3
1

Enzo SQL Shard SQL Server. NHibernate, ,

0

Source: https://habr.com/ru/post/1751256/


All Articles