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

3

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

Nocturnal answered 27/8, 2010 at 0:19 Comment(2)
possible duplicate of Embedded database for .netTreacle
also #2842689 and #271819Treacle
L
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.

Liba answered 31/8, 2010 at 13:53 Comment(2)
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.Nocturnal
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.Touchback
K
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.

Kourtneykovac answered 9/9, 2012 at 13:40 Comment(0)
T
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.

Treacle answered 27/8, 2010 at 1:15 Comment(3)
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.Nocturnal
@David B: see fluent nhibernate's auto mappings: wiki.fluentnhibernate.org/Auto_mappingTreacle
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.Nocturnal

© 2022 - 2024 — McMap. All rights reserved.