How NHibernate saved my day

I am working on an ecommerce site as a personal learning project. Rob Conery’s MVC Storefront series of blog posts was my inspiration. However, I am following a different path. I am using NHibernate instead of Linq-To-Sql.

I determined that the hosting budget for this little project would be exceeded by any reputable hosting provider that offers Microsoft SQL server. I did find, however, several hosting providers that offered MySql at an acceptable rate.

After a half hour or so of fumbling around with installing MySql on my dev box for the very first time, and setting up an empty database, it was time to migrate my code over.

A couple of NHibernate configuration changes, and a couple of minor tweaks (and I mean very minor), my entire project was working against MySql. My database integration tests export the schema to the database, so I didn’t even have to create any tables manually. Migrating my code from one database vendor to another took less than 5 minutes.

I sat back and said to myself, “Wow!”

I shared this experience with a couple of co-workers, and they said the same thing.