Peter Morlion logo


Data storage for a stand-alone client application

I’m developing a stand-alone client application that will be able to store a fair amount of data. No client-server stuff, just plain old open-the-application-change-the-data-save-close. I need a good way to store the data and, traditionally, developers look at SQL databases for data storage. But I’m thinking this will make it overly complex. A search for alternatives starts.

The application is for the administration of a speech therapist. It should have the patients, appointments, documents, etc. But also more complex business logic such as calculating payments for patients (which in Belgian social security can be complex), calculating how many more session (appointments) a patient can have (which can be, but isn’t always, legally regulated), etc. So just an Excel file or an Access database won’t do. And besides, I’m a .NET developer.

So you’d take a SQL database right? With the compact edition, no? And, being all up-to-date on our developing skills, use NHibernate! Well, I’ve been reading the No SQL posts by Ayende with much interest (and some other blogs too), and it hit me that the whole SQL and mapping files thing is quite complex.

I know there a lot of info out there on how to use NHibernate, but I must say, it stays kind of hard to do it right. You always get into trouble using collections, you have to make compromises in your domain, there’s all sorts of best ways to manage your sessions, etc. Being a developer, and not a database specialist, I won’t to write code, instead of having to hassle with data storage details.

Why not go old school, and save your objects to file (binary or xml)? I could do that, but I don’t have any experience with doing this on a lot of objects, objects that hold other objects, I don’t know how this affects performance, …

So I did start looking for object databases or document databases. db4o looked promising and I must look into it further. I first discarded it as an option due to licensing (I might go commercial with my application if all goes well). I checked other options like the most known ones: MongoDB, CouchDB, but they seemed quite complex also, in part because they’re not targeting the .NET platform.

So I ended up choosing RavenDB, which has a paying license for commercial applications also, like db4o. But I haven’t gone into the details of the licensing yet, so I couldn’t tell you the difference. Maybe I didn’t give db4o a decent chance, but I’m going to try RavenDB now anyway.

Leave a Reply

Your email address will not be published. Required fields are marked *