Can mongodb be used as an embedded database?
Asked Answered
R

7

61

I am working on a RSS reader application. And I need to find a backend database. I want the database be embedded because I don't want the users to install a database server.

I know SQLite is a good choice, but I am wondering if there are any other nosql choices?

Ridley answered 24/5, 2011 at 19:14 Comment(1)
I'm not sure, but it sounds like you want an embedded database, which is the opposite of stand-alone.Byron
R
18

According to the Google Group, yes it can, but it doesn't cover how exactly.

Yes, but it isn't pretty and will force your app to be AGPL licensed. If you are interested take a look at how the tools handle the --dbpath option.

Source: http://groups.google.com/group/mongodb-user/browse_thread/thread/463956a93d3fb734?pli=1

If you're using .NET, one option might be RavenDB, which is a document database, and can be embedded.

Ramiah answered 24/5, 2011 at 19:54 Comment(2)
Great answer, but also check out Steve McDowell's answer & licensing source at mongodb.org/display/DOCS/LicensingPuritan
Just to point out RavenDB is also AGPL unless your project is open sourceSabba
C
55

(I don't yet have 50 rep points to comment on, and build upon, the accepted answer; otherwise I would, sorry!)

You can embed MongoDB in your OEM solution but there are two things to consider:

  1. It is written in C++, so if you are coding in a different language you might need to write a wrapper that launchers the database process separately.

  2. MongoDB is licensed under Gnu AGPL-3.0 which is a copy left server license. The accepted answer, and the Google group quote, both correctly state that this would normally force you to also be AGPL licensed. However, they MongoDb states that the intention of the license is to allow refinements to their code to be submitted back, and that your product will remain separate. This makes me think that the normal copy left rules don't apply.

The goal of the server license is to require that enhancements to MongoDB be released to the community. Traditional GPL often does not achieve this anymore as a huge amount of software runs in the cloud. For example, Google has no obligation to release their improvements to the MySQL kernel – if they do they are being nice.

To make the above practical, we promise that your client application which uses the database is a separate work. To facilitate this, the mongodb.org supported drivers (the part you link with your application) are released under Apache license, which is copyleft free. Note: if you would like a signed letter asserting the above promise please request via email.

Source: http://www.mongodb.org/display/DOCS/Licensing

Crownwork answered 1/3, 2012 at 12:38 Comment(0)
R
18

According to the Google Group, yes it can, but it doesn't cover how exactly.

Yes, but it isn't pretty and will force your app to be AGPL licensed. If you are interested take a look at how the tools handle the --dbpath option.

Source: http://groups.google.com/group/mongodb-user/browse_thread/thread/463956a93d3fb734?pli=1

If you're using .NET, one option might be RavenDB, which is a document database, and can be embedded.

Ramiah answered 24/5, 2011 at 19:54 Comment(2)
Great answer, but also check out Steve McDowell's answer & licensing source at mongodb.org/display/DOCS/LicensingPuritan
Just to point out RavenDB is also AGPL unless your project is open sourceSabba
U
15

Please checkout https://github.com/Softmotions/ejdb This project being developed to resolve this issue.

Unkind answered 28/10, 2012 at 14:33 Comment(1)
That's a promising project, too bad there are limited drivers for other languages. github.com/dan-eyles/sculejs seems promising too.Statfarad
O
5

How about Couchbase Lite? It's an open source, embeddable document database. While it can function as a standalone document database, its real value is in its ability to synchronize with remote document databases. It may be aimed at iOS / Android, but it can run on anything with a JVM.

https://github.com/couchbase/couchbase-lite-java

Overstrain answered 10/4, 2014 at 22:43 Comment(0)
B
2

There is no straight forwarding way to use MongoDB as an embedded library in terms of a well-reusable library. Eliot - head of 10gen - spoke of "it would be nice to have one" - but there is nothing available that could be reused in a sane way.

Busoni answered 25/5, 2011 at 3:59 Comment(0)
C
0

Looks like a lot of OEMs are trying to get Mongo on to their hardware and devices for real-time processing. A link from MongoDBs website

Catalectic answered 2/6, 2015 at 18:45 Comment(0)
C
0

I usually use Buildroot to create a cross-compiled Embedded Linux root file-system along with all the user space packages.

I noticed that MongoDB is one of the packages that's already integrated as one of the Buildroot builtin packages.

You may check out MongoDB make file for some hints regarding how to built it for Embedded Linux.

Cabinetwork answered 12/12, 2021 at 13:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.