NHibernate or EF, Shards or manual sharding?
I'd like to know if I'm making the right decision. I'm developing an application that allows the user to mix database entries from a local database (possibly SQL CE or SQLite) and from a remote, shared database (most probably MySQL). Ideally it would have to be flexible and compatible with several database server types (sta开发者_JAVA百科tically as per initial config, not mixing several types dynamically) but this is not a show-stopper.
The code is C#, .NET 4.
Naturally, I was thinking about NHibernate since it features LINQ in version 3.0, a plus for code readability and efficiency, and the model-first approach is more natural than Entity Framework. It also has Shards for the mixed database part, which should be much easier to handle. The other option is EF 4, which I would otherwise favour since it's fully supported in the .NET context and by Visual Studio, and has a promising future there.
Is Shards mature enough? It has been stuck to 3 beta for quite a while now and looks like a dead project, have people deployed professional applications based on this extension? Does it have a future? Or is there another option?
Does NHibernate 3 run on Mono? I think so, but an actual confirmation would be great. That would be another advantage over EF if a web server has to be developed as alternative interface.
Thanks in advance for any information or feedback!
Update 1
Apparently .NET 4 is an issue and in order to use NHibernate, .NET 3.5 is wiser. Also, there are clearly issues with SQLite and SQL CE, or other parts of the framework like WPF.
Does NHibernate allows sharding across different database types (for example MySQL and SQLite)?
So I'm starting to believe EF 4 is safer for the client side, and NHibernate when it comes to a possible ASP.NET interface.
Sharding is designed (for a known schema) redirect calls to a known server i.e. names starting with a,b,c,d to server a and e,f,g,h to server b etc.
I haven't heard of it being used cross database server make. I would doubt that this works.
Sharding has it place but I can imagine there might be intermittent issues which are difficult to resolve if different shards have different performance profiles.
There is this link which indicates that it possible to run NH3 under mono ... https://nhibernate.jira.com/browse/NH-2312
Remote shared database I would tend to abstract away through a known API using WCF or REST.
精彩评论