Search code examples
nhibernatedb4oembedded-databaseravendb

Looking for guidance on embedded .NET database (such as db4o, NHibernate, or RavenDB)


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


Solution

  • 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
    • It does not support the .NET Framework Client Profile (which is of particular importance as the OP's question is concerning embedded databases)

    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.