17

Is there something akin to SQLite but a document-oriented database as opposed to an RDBMS?

Orient seemed to be something similar to what I was looking for, but it is written in Java, and I'm looking for something I can use from C++.

Ideally this would be a serverless system, like SQLite.

Varun Madiath
  • 3,152
  • 4
  • 30
  • 46

8 Answers8

16

UnQLite

UnQLite is a in-process software library which implements a self-contained, serverless, zero-configuration, transactional NoSQL database engine. UnQLite is a document store database similar to MongoDB, Redis, CouchDB etc. as well a standard Key/Value store similar to BerkeleyDB, LevelDB, etc.

UnQLite is 100% hand-coded, written in ANSI C, Thread-safe, Full reentrant, compiles unmodified and should run in most platforms including restricted embedded devices with a C compiler. UnQLite is extensively tested on Windows and UNIX systems especially Linux, FreeBSD, Oracle Solaris and Mac OS X.

Houman Javidpour
  • 468
  • 8
  • 11
  • 1
    It should also be noted that UnQLite actually uses many of the same methods to manage its database that SQLite does. It even has the same locking semantics. It really is the no-sql alternative to SQLite. – Matthew May 07 '14 at 21:42
  • 3
    The unfortunate thing about UnQLite is the interface is decidedly *not* C++. – Steve Oct 04 '14 at 18:33
  • How about licensing? It seems to be BSD license compatible http://unqlite.org/licensing.html - yet I am not sure this can be used in commercial applications. – enthusiasticgeek Nov 29 '14 at 16:21
  • 1
    unqlite is buggy and unmaintained - it will crash frequently and kill your all your data. – Lothar Jan 02 '17 at 00:19
  • 1
    @Lothar how did you come to this conclusion? – Victor Queiroz Dec 18 '18 at 03:15
1

Did you consider using Xapian, the C++ counterpart of Lucene? It helps you store and run complex queries on documents with multiple fields.

Eser Aygün
  • 7,794
  • 1
  • 20
  • 30
  • I hadn't heard of the project. I went and looked it up, but it doesn't seem to be a document database (in the sense that couchdb or mongodb is), but more of a full text search library for a collection of documents. If I'm wrong, please do correct me. – Varun Madiath May 26 '11 at 11:51
  • You are right. Still, you can treat it as a flexible key-value storage with extra fields and range queries and full text search, etc. – Eser Aygün May 26 '11 at 12:10
1

Another proposal is to use Berkley DB as it is optimized for embedded access to data and very mature. They do not only provide a K/V based access but in addition SQL-like, XML, and Java Object Access. In addition checkout this overview.

grundprinzip
  • 2,471
  • 1
  • 20
  • 34
1

Actually CouchDB is not strictly server-oriented. It's intended to run on a variety of environments. See here for couch on mobile.

Erlang, CouchDB’s implementation language has been designed to run on embedded devices magnitudes smaller and less powerful than today’s phones.

From http://guide.couchdb.org/draft/why.html

Tokyo/Kyoto Cabinet is written in C++, but is a simple key-value store.

See the complete nosql list for other alternatives: http://nosql-database.org/

Ricardo Tomasi
  • 34,573
  • 2
  • 55
  • 66
  • I know Erlang is highly effective, but the couchDB is a pretty large thing to include in an application. The binary installer for windows is 51 MB. So bundling that with an application seems like a pretty large task. I'm guessing the bundling of Erlang is the reason it's so large. – Varun Madiath May 28 '11 at 05:50
  • Additionally, the need to have the couchdb server run, in it's own process seems like overkill. It fits in well for web applications, but when you are designing a desktop app, running in-process would be ideal, as it would shut down the moment the application shut down. – Varun Madiath May 28 '11 at 05:52
0

There is RavenDB, written in .NET, with an embedded version.

synhershko
  • 4,472
  • 1
  • 30
  • 37
  • I looked at the embeddable version, but I'm not sure I can use it with a C++ application. Am I wrong in that assumption? – Varun Madiath May 22 '11 at 03:11
  • You'll need to use Managed C++ on top of .NET / Mono - it requires the .NET framework. – synhershko May 22 '11 at 04:57
  • Thanks.I was planning on using Qt for most of my application, so that makes this a no-go. For another project though, I'll be sure to look into this. Thanks. – Varun Madiath May 22 '11 at 05:07
  • You can always write a C++ -> interop layer in MC++ then expose only pure C++ / C function exports from the DLL. Then your QT app can pretend it's just a C library. Should be easy to make it self contained. I've done the reverse direction tons of times in C# -> C++ and it's worked fine (although that way PInvoke usually beats MC++). – Michael Kennedy May 26 '11 at 19:40
  • @Micheal Kennedy - I didn't know that was possible. I've read about exposing C/C++ code to C#, but I wasn't aware that managed code could be exposed to C++. Any idea where I could find a tutorial that explained how to do something like that. – Varun Madiath May 29 '11 at 13:45
  • @VarunMadiath I think you still need the .net framework even the C# function is exposed. – AZ. Jul 25 '13 at 17:41
0

Try hamsterdb. It's written in C and it has also C++ support (among others). There are many platforms supported.

amra
  • 16,125
  • 7
  • 50
  • 47
  • I looked at it, and while it's cool, it's a key-value store, and the ability to query by something other than the key is fairly import to me. – Varun Madiath May 26 '11 at 11:52
0

I haven't tried myself, but maybe this one would meet your requirements:

--CouchDB

http://couchdb.apache.org/

with

--C++ library for communicating with Apache CouchDB

http://code.google.com/p/couchdbpp/

EDIT.

I have answered too fast I see, as CouchDb is rather server oriented. Nevertheless, take a look.

rsc
  • 4,234
  • 2
  • 30
  • 28
  • Yeah, I know of couchDB, ravenDB (thanks to synershko), and mongoDB. CouchDB is very server oriented, and there is no embeddable version, everything works over http requests. – Varun Madiath May 26 '11 at 12:12
-1

There's also Fossil.

Two questions (or criticisms) that arise frequently regarding Fossil can be summarized as follows:

Why is Fossil based on SQLite instead of a distributed NoSQL database? Why is Fossil written in C instead of a modern high-level language? Neither question can be answered directly because they are both based on false assumptions. We claim that Fossil is not based on SQLite at all and that Fossil is not based on a distributed NoSQL database because Fossil is a distributed NoSQL database. And, Fossil does use a modern high-level language for its implementation, namely SQL.

Alix Axel
  • 151,645
  • 95
  • 393
  • 500