mongodb 可以用作嵌入式数据库吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6115637/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can mongodb be used as an embedded database?
提问by Bill Yan
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.
我正在开发一个 RSS 阅读器应用程序。我需要找到一个后端数据库。我希望嵌入数据库,因为我不希望用户安装数据库服务器。
I know SQLite is a good choice, but I am wondering if there are any other nosql choices?
我知道 SQLite 是一个不错的选择,但我想知道是否还有其他 nosql 选择?
采纳答案by Joe Doyle
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.
是的,但它并不漂亮,并且会强制您的应用获得 AGPL 许可。如果您有兴趣,请查看这些工具如何处理 --dbpath 选项。
Source: http://groups.google.com/group/mongodb-user/browse_thread/thread/463956a93d3fb734?pli=1
来源: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.
如果您使用 .NET,一个选项可能是RavenDB,它是一个文档数据库,可以嵌入。
回答by Steve McDowell
(I don't yet have 50 rep points to comment on, and build upon, the accepted answer; otherwise I would, sorry!)
(我还没有 50 个代表点来评论和建立已接受的答案;否则我会,对不起!)
You can embed MongoDB in your OEM solution but there are two things to consider:
您可以在 OEM 解决方案中嵌入 MongoDB,但需要考虑两件事:
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.
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.
它是用 C++ 编写的,因此如果您使用不同的语言进行编码,您可能需要编写一个包装器来单独启动数据库进程。
MongoDB 在 Gnu AGPL-3.0 下获得许可,这是一个副本左服务器许可。接受的答案和 Google 小组的引用都正确地说明,这通常会迫使您也获得 AGPL 许可。然而,他们 MongoDb 声明许可证的目的是允许提交回他们代码的改进,并且您的产品将保持独立。这让我认为正常的副本左规则不适用。
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.
服务器许可证的目标是要求向社区发布 MongoDB 的增强功能。由于大量软件在云中运行,传统的 GPL 通常不再能够实现这一点。例如,谷歌没有义务发布他们对 MySQL 内核的改进——如果他们这样做了,他们就很好。
为了使上述内容切实可行,我们承诺您使用数据库的客户端应用程序是一项单独的工作。为方便起见,mongodb.org 支持的驱动程序(您与应用程序链接的部分)是在 Apache 许可下发布的,该许可是无版权的。注意:如果您想要一份声明上述承诺的签名信,请通过电子邮件索取。
回答by Anton
Please checkout https://github.com/Softmotions/ejdbThis project being developed to resolve this issue.
请查看https://github.com/Softmotions/ejdb这个正在开发的项目是为了解决这个问题。
回答by Shane
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.
Couchbase Lite 怎么样?它是一个开源的、可嵌入的文档数据库。虽然它可以作为一个独立的文档数据库运行,但它的真正价值在于它能够与远程文档数据库同步。它可能针对 iOS / Android,但它可以在任何带有 JVM 的设备上运行。
回答by Andreas Jung
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.
就可重复使用的库而言,没有直接的方法可以将 MongoDB 用作嵌入式库。Eliot - 10gen 的负责人 - 谈到“拥有一个会很好” - 但是没有任何可用的东西可以以理智的方式重用。
回答by Praneesh
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
看起来很多 OEM 都在尝试让 Mongo 使用他们的硬件和设备进行实时处理。来自 MongoDB 网站的链接