← Back to team overview

maria-discuss team mailing list archive

Re: NHibernate and MariaDB


Hi Jake

On 05/04/2011, at 5:51 AM, Jake Drew wrote:
I have recently been converting 3 SQL Server Databases to MariaDB for a website our company is repackaging. One of the developers is requesting that during our updates we implement HHibernate as an ORM tool for each database.

I am not familiar with NHibernate. I am also wondering, if anyone has used this technology with MariaDB or otherwise? If so, what are the performance implications and/or benefits within the context of MariaDB?

Sure Hibernate & co have been used for many years with MySQL apps, and now MariaDB.
Naturally an ORM introduces some overhead.

The benefits are as follows
- with a dev team, the ORM enforces some form of standardisation in how things are designed and called. Depending on the team, this can be highly beneficial and prevent some damaging bad habits. - having this standard interface negates the "need" for developing ones own db API and needing to debug it; in addition, new developers may already be familiar with Hibernate and thus quicker working on the app. - code like connection pools and some caching is available and well tested, no need to reinvent the wheel there either.

So I think that in many (if not most) dev teams, using this kind of interface layer makes sense.

I do *not* believe in using a database abstraction layer to create database independence, because it's a fallacy. Inevitably you'll have made design choices more optimal for the initial target: hardware, schema layout, server behaviour, etc. Thus migrating would be non- optimal, it's always costly and painful, and even when you don't migrate you're restricting yourself to only use "standard" features and no RDBMS-specific tricks. Particularly in a web context and with MySQL, that just makes no sense. Best to design right for scalability (master-slave, sharding, etc), then migration later should not be necessary.

hope this helps!
My company advises on these topics quite often, and thus we're quite familiar with the issues as well as being able to see the outcome over time.

Arjen Lentz, Exec.Director @ Open Query (http://openquery.com)
Remote expertise & maintenance for MySQL/MariaDB server environments.

Follow us at http://openquery.com/blog/ & http://twitter.com/openquery