Can MongoDB be hosted in-process?

元气小坏坏 提交于 2019-12-08 15:11:24

问题


Currently, everything that I've read indicates that you must run MongoDB as a separate process/service. Is there any way to host MongoDB in-process? If not now, are their known plans to implement such a feature?


回答1:


Based on my experience with MongoDB and my skimming of the issue tracker tickets at http://jira.mongodb.org/browse/SERVER, I don't know of any way to host MongoDB in process. I also found no evidence of future plans to do so.

I would recommend asking this question on the mongodb-user mailing list: http://groups.google.com/group/mongodb-user




回答2:


MongoDB is GNU AGPL licensed so if you include (link) in your application then the source of that application will also be GNU AGPL licensed. You can of course launch MongoDB from your application at startup and terminate MongoDB again when the application stops.




回答3:


You could use the Embedded MongoDB library, although it was designed for unit testing purposes.




回答4:


Another Stack Overflow question has answers relevant to this question.

Embedded MongoDB when running integration tests

Specifically, it mentions an in-memory MongoDB for the JVM named Fongo.

Looks like Fongo is mainly for integration tests and/or learning. It may not handle all Mongo use-cases, but is worth a look.

https://github.com/fakemongo/fongo



来源:https://stackoverflow.com/questions/2210029/can-mongodb-be-hosted-in-process

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!