MangoDB is modernized and now changes to FerretDB

Recentlys days the news of the launch of the project was announced FerretDB, (formerly MangoDB), which allows you to replace MongoDB's document-oriented DBMS with PostgreSQL without making any changes to your application code.

FerretDB is implemented as a proxy server that translates calls to MongoDB into SQL queries to PostgreSQL, allowing you to use PostgreSQL as the actual storage.

FerretDB (formerly MangoDB) was founded to become the de facto open source replacement for MongoDB. FerretDB is an open source proxy that converts MongoDB wire protocol queries to SQL, using PostgreSQL as the database engine.

The need for migration may arise due to the transition of MongoDB to a non-free SSPL license, which is based on the AGPLv3 license, but is not open source, as it contains a discriminatory requirement to provide under the SSPL license not only the application of the code itself, but also the source codes of all the components involved in providing the cloud service.

The target audience for FerretDB is users who do not use the advanced features of MongoDB in their applications, but want to use a completely open software stack.

In the current stage of development, FerretDB it still supports only part of MongoDB features that are most often used in typical applications. In the future, they plan to achieve full driver support for MongoDB and provide the ability to use FerretDB as a transparent replacement for MongoDB.

Remember that MongoDB occupies a niche among fast and scalable systems that operate on data in key/value format, and relational DBMS, functional and convenient in generating queries.

Most MongoDB users don't need many of the advanced features that MongoDB offers; however, they need an easy to use open source database solution. Recognizing this, FerretDB is here to fill that gap.

MongoDB supports storing documents in a JSON-like format, has a fairly flexible language for generating queries, can create indexes for various stored attributes, provides efficient binary large object storage, support logging of operations to change and add data to the database, it can work according to the Map/Reduce paradigm, it supports replication and the construction of fault-tolerant configurations.

In the release of FerretDB 0.1.0 it is noted that completely redesigned the way PostgreSQL data is retrieved. Previously, for each incoming MongoDB request, an SQL to PostgreSQL query was generated, using functions to work with the JSON format and filtering the results on the PostgreSQL side.

Due to the differences in the semantics of PostgreSQL and MongoDB json functions, there was a discrepancy in behavior when comparing and ordering different types. To solve this problem, a sample of redundant data is now extracted from PostgreSQL and the filtering of the result is done on the FerretDB side, which made it possible to repeat the behavior of MongoDB in most situations.

The price of increased compatibility was a performance penalty, which in future releases is expected to be offset by selective filtering on the FerretDB side of only queries for which there is a behavioral divergence.

For example, the query "db.collection.find({_id: 'some-id-value'})" can be fully processed in PostgreSQL. The main goal of the project at this stage of development is to achieve compatibility with MongoDB, and performance is still relegated to the background.

Of the functional changes in the new version, there is support for all bitwise operators, the "$e" comparison operator, as well as the "$elemMatch" and "$bitsAllClear" operators.

Finally for those interested in knowing more about it, they should know that the code is written in Go and is distributed under the Apache 2.0 license and you can check its code in the following link.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.