6

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

David B
  • 117
  • 1
  • 8
  • possible duplicate of [Embedded database for .net](http://stackoverflow.com/questions/684595/embedded-database-for-net) – Mauricio Scheffer Aug 27 '10 at 01:12
  • also http://stackoverflow.com/questions/2842189/good-embedded-database-solution-like-sqlite-for-net and http://stackoverflow.com/questions/271319/lightweight-sql-database-which-doesnt-require-installation – Mauricio Scheffer Aug 27 '10 at 01:15

3 Answers3

10

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.

Maate
  • 1,000
  • 1
  • 6
  • 15
Gamlor
  • 12,978
  • 7
  • 43
  • 70
  • 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 Sep 01 '10 at 01:10
  • As an *embedded* database, NHibernate has serious issues. I'd choose Linq-To-SQL or EntityFramework4 long before choosing NHibernate at this point. Both of those technologies are baked into the framework and have no external dependencies. – Eric Falsken Nov 07 '10 at 17:45
3

Firebird is a terrific embedded database which has long supported all the modern features of an enterprise database:

  • ANSI SQL
  • ACID
  • Stored procedures
  • Triggers

You can get the .NET provider (last updated May 24th according to the site) and it supports Entity Framework and Linq.

John Hurrell
  • 350
  • 4
  • 11
0

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.

Community
  • 1
  • 1
Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
  • 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 Aug 27 '10 at 03:15
  • 1
    @David B: see fluent nhibernate's auto mappings: http://wiki.fluentnhibernate.org/Auto_mapping – Mauricio Scheffer Aug 27 '10 at 04:05
  • 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 Aug 30 '10 at 11:49