Jordan
Jordan

Reputation: 2851

Can MongoDB be hosted in-process?

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?

Upvotes: 12

Views: 3713

Answers (4)

David J.
David J.

Reputation: 32705

Based on my experience with MongoDB and my skimming of the issue tracker tickets, 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.

Upvotes: 3

devdanke
devdanke

Reputation: 1590

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

Upvotes: 0

Konrad Reiche
Konrad Reiche

Reputation: 29493

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

Upvotes: 1

diederikh
diederikh

Reputation: 25271

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.

Upvotes: 1

Related Questions