Embeddable document store database [closed]
Asked Answered
J

8

18

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.

Jaunitajaunt answered 21/5, 2011 at 7:40 Comment(0)
M
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.

Masha answered 24/5, 2013 at 20:21 Comment(5)
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.Holinshed
The unfortunate thing about UnQLite is the interface is decidedly not C++.Thirteen
How about licensing? It seems to be BSD license compatible unqlite.org/licensing.html - yet I am not sure this can be used in commercial applications.Chemoprophylaxis
unqlite is buggy and unmaintained - it will crash frequently and kill your all your data.Krasnodar
@Krasnodar how did you come to this conclusion?Jauregui
E
1

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

Enthalpy answered 26/5, 2011 at 11:35 Comment(2)
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.Jaunitajaunt
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.Loiret
T
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.

Trough answered 26/5, 2011 at 17:31 Comment(0)
K
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: https://hostingdata.co.uk/nosql-database/

Kanter answered 28/5, 2011 at 4:25 Comment(2)
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.Jaunitajaunt
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.Jaunitajaunt
P
0

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

Papaverine answered 22/5, 2011 at 0:10 Comment(6)
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?Jaunitajaunt
You'll need to use Managed C++ on top of .NET / Mono - it requires the .NET framework.Papaverine
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.Jaunitajaunt
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++).Oribelle
@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.Jaunitajaunt
@VarunMadiath I think you still need the .net framework even the C# function is exposed.Upbow
G
0

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


hamsterdb has been renamed to upscaledb

Godunov answered 26/5, 2011 at 11:18 Comment(1)
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.Jaunitajaunt
B
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.

Buttress answered 26/5, 2011 at 11:56 Comment(1)
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.Jaunitajaunt
R
-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.

Repurchase answered 24/12, 2012 at 7:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.