This project is read-only.

Thoughts on Multiple DB support

Jan 22, 2012 at 7:46 AM
Edited Jan 22, 2012 at 7:56 AM

Have any of the developers or contributors given any thought into how best to approach generalising nHydrate a little to allow for different DB engines?

Having looked through the code I see that there are some "hard-codings/assumptions" towards SQL server, however, there does seem to be a few general blacks of SQL specific code and generation code such as in the Generator.Installer and DAL.

I was curious if there were any perceived problems in extending the framework to support multiple DBs? If the developers have some architecture thoughts on this I'd be interested in contributing.

 I know other ORMs support other DBs, but nHydrate seems quite straight forward and sensible to use!




Jan 22, 2012 at 8:00 PM

There are hard-coded assumptions for SQL Server. This was by design. The project was never designed to be all things to all people. The rationale behind this was that completely generic products really do not satisfy anyone. Everyone has some feature they want added to support some framework specific quirk. The whole project was designed to be .NET platform specific using SQL Server. We can add all sorts of custom features by not worrying about all different database dialects on the data side and all the different feature sets like Java, .NET, Ruby, PHP, etc on the code side. This was just our thought process.

Jan 22, 2012 at 10:34 PM

Totally understandable building for .NET and MSSQL only but I have to say i do partly agree with the first post. nHydrate is one of the easiest and best ORM's out there for dotnet but i do wish it would also support mysql or at least a DB that does not cost a fortune and can run on something else than windows.  .NET is not just windows any more and for someone like my self that develops small projects for personal use and small online user bases nHydrate is perfect apart from the cost of hosting/licensing.  I use a min of linux VPS with mono and a windows host account for the sql server for the min.  You can generally get 2-4 linux VPS for the cost of 1 windows VPS with ms sql server.

I am not saying everything should be supported for different DBs.  It would be nice though if MSSQL was the primary DB and 1-2 other major free/cross platform DBs were supported with a reduced feature set.  That way you could start off cheaply and if the idea works out and pays for itself upgrade to a MS SQL Database without changing the whole datalayer.

That said if anyone knows of a really good easy to use ORM for mysql and .NET let me know. nHydrate rocks and it does such a great job but i just wish it could be a little more flexible DB support wise.

Ever though about asking how many would be interested in Support for something like MySQL been added and how much people would donate for that support to be added.  I know i would be will to give a little ($50-$100) and maybe if enough were interested it may be worth considering?

Jan 22, 2012 at 11:59 PM

codetools: I certainly understand why you've kept nHydrate specific to one stream of things, I guess I was more interested in any stray throughts the developers (such as yourself) may have had about the issues or the best design you'd like to see regarding support for other DBs.

To put things another way, if the core development work on nHydrate stuck as MSSQL, yet you guys looked to providing some abstraction and ability to use another DB, what would your thoughts or direction on that be?

Jan 23, 2012 at 12:07 AM

seer_tenedor: I'm in a similar boat and I'd like to be using nHydrate+MySQL. We looked at a few DBs for our projects and the 3 key criteria weren't met by MSSQL: 1 - Easy to install in your own setup (MySQL you just copy files and create a service, MSSQL is possible by messy). 2 - Small install and running footprint (a stripped down MySQL is about a 3Meg setup and maybe 20meg installed). 3. Easy and reasonable hosting of the DB (same arguments as yours).