views:

149

answers:

2

I have an object model that I want to store using an embedded database. I have so far been looking at db4o, NHibernate to SQLCE (w/ linq), and RavenDB. This would be used in a desktop C# application.

The key features I am looking to leverage are: Linq or similar for queries (no SQL or HQL), Embedded data engine, pocos, poco first model, no install (no registry or similar)

Can any one suggest one? Are the three I am looking at the best choices? Are there other options? Of the three, can anyone recommend one over the other?

Thanks

A: 

See this question. For LINQ support, check out DbLinq, or since you already intend to use NHibernate you can use NHibernate's own LINQ provider.

Mauricio Scheffer
I did see those other posts. The problem was that they focus on embedded relational data stores, and I am looking for something to store an object model in. They provide options for behind NHibernate. DbLinq would provide me a linq provider to the underlying datastore, but it will not provide the rich POCO first model I am looking for.I do appreciate the suggestion, and if I go with NHibernate, I might consider those options. However, I am still looking for suggestions for what would work best at the POCO first model.
David B
@David B: see fluent nhibernate's auto mappings: http://wiki.fluentnhibernate.org/Auto_mapping
Mauricio Scheffer
Thanks, that has been what I was considering. However, I have been seeing more positive news about the other two lately, and was hoping to find out if NHibernate was still the defacto choice.
David B
+3  A: 

Well the three suggested databases are very different in their nature. SQLCE with Hibernate as RDBMS with a ORM, db4o as object database and RavenDB as document database. Each of them has its strengths.

SQL CE & NHibernate-Combo The good:

  • Extremely good support in tooling, the knowledge and a big community is there
  • Easy to upgrage to MS SQL servers
  • Extrem good reporting support
  • The power of SQL

The bad:

  • Needs mapping
  • The mapping between the OO and relational world is not easy and can lead to issues with complex models.

RavenDB

The good:

  • Doesn't need any mapping
  • Easy to use
  • Powerful indexing
  • JSON & HTTP access

The bad:

  • If your domain doesn't fit to a document-oriented approach, it will be quite painful

db4o

The good:

  • Doesn't need any mapping
  • Easy to use
  • The storage model is close the object-model. This also works for very complex models.
  • -

The bad:

  • Tooling support is weak.

Afaik all three support LINQ and POCO-first approach. However since NHibernate & SQL CE still need tons of mapping its not as friction free as it could be.

I think if your focus is on POCO first, LINQ-support, ebedded usage and easy to use, I would try RaveDB or db4o. If your focus is on 'safety', community-knowledge, tool-support and reporting I would go with NHibernate and SQL CE.

Gamlor
Thanks. Given that my domain is not so large as to make the mapping effort too much effort, I believe the NHibernate approach might be best. Primarily because of the community support. RavenDB is a bit too new to have a large knowledge base yet.
David B