Mongita Embedded MongoDB Alternative Announced
Written by Kay Ewbank   
Thursday, 29 April 2021

Mongita, a lightweight embedded document database that implements a commonly-used subset of the MongoDB/PyMongo interface, has been announced. The open source Python library is intended to be useful to Python developers who want to use JSON files but don't want the overhead of a MongoDB server.

Mongita can be configured to store its documents either on disk or in memory. The main developer, Scott Rogowski, says Mongita is a good alternative to SQLite for embedded applications when a document database makes more sense than a relational one.

mongita

He also suggests Mongita would be good for unit testing:

"Mocking PyMongo/MongoDB is a pain. Worse, mocking can hide real bugs. By monkey-patching PyMongo with Mongita, unit tests can be more faithful while remaining isolated."

Mongita implements a commonly-used subset of the PyMongo API, meaning that projects could be started with Mongita and upgraded to MongoDB if and when they get large enough to warrant the move. The library is embedded and self contained, doesn't need a server and doesn't start a process.

In terms of performance, Rogowski says Mongita is within an order of magnitude of MongoDB and Sqlite in 10k document benchmarks, and is well tested, with 100% test coverage and more test code than library code.

mongita performance

Another advantage of Mongita is its limited dependencies, as it will run anywhere that Python runs. The only dependencies are pymongo (for bson) and sortedcontainers (for faster indexes). Mongita also offers experimental thread-safety, avoiding race conditions by isolating certain document modification operations.

Rogowski isn't advocating Mongita for all uses, saying it should be avoided in situations that need a traditional server/client configuration as it isn't process-safe, so if you have multiple clients it should be avoided.

It is also limited in the commands it implements, concentrating on the most commonly used subset, so isn't suitable when MongoDB's less common commands are needed. Robowski says the goal is to eventually implement most of MongoDB, but t will take some time to get there.

Performance is another consideration; while Mongita has comparable performance to MongoDB and SQLite for common operations, Robowski admits it's possible you'll find bottlenecks - especially with uncommon operations.

 mongita

More Information

Mongita On GitHub

Related Articles

MongoDB Trends

Studio3T MongoDB GUI Adds Migration

MongoDB Atlas Adds MultiCloud Cluster Support

MongoDB Improves Query Language

MongoDB 4.0 Gets Multi-Doc ACID Support

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Generative AI Training For All On Coursera
04/03/2024

Generative AI is on the loose, getting into business and commerce as well as into art, poetry and coding. Already useful, it  will become ever more useful as long as we use it properly. Coursera  [ ... ]



SnapCode: A Java IDE for the Web
27/02/2024

Thanks to CheerpJ and WebAssembly you can now run a Java IDE inside your browser and local first.This is SnapCode, and while lightweight and in-browser, is to be not underestimated.


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Thursday, 29 April 2021 )