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


AI Propels Python To Top Language on GitHub
30/10/2024

This year's Octoverse Report reveals how AI is expanding on GitHub and that Python has now overtaken JavaScript as the most popular language on GitHub. The use of Jupyter Notebooks has also surged.



Highlights Of The Europe 2024 PostgreSQL Conference
22/11/2024

This year's premium conference for PostgreSQL took place in Athens, Greece between October 22-25. The nice Athenian weather and cultural aspect aside, the conference was a big hit too.


More News

espbook

 

Comments




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

Last Updated ( Thursday, 29 April 2021 )