Release of FerretDB 0.1, a MongoDB implementation based on the PostgreSQL database.

The release of FerretDB 0.1 (formerly MangoDB) has been published, allowing the document-oriented database MongoDB to be replaced with PostgreSQL without changing application code. FerretDB is implemented as a proxy server that translates calls to MangoDB into SQL queries for PostgreSQL, enabling PostgreSQL to act as the actual storage. The code is written in Go and is distributed under the Apache 2.0 license.

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

FerretDB targets users who do not utilize the advanced features of MongoDB in their applications but wish to use a fully open software stack. At this stage of development, FerretDB currently supports only a part of the capabilities of MongoDB that are most commonly used in standard applications. In the future, they plan to achieve full compatibility with MongoDB drivers and provide the ability to use FerretDB as a transparent replacement for MongoDB.

It should be noted that MongoDB occupies a niche between fast and scalable systems that operate on key/value formatted data and relational databases, which are functional and convenient for query formation. MongoDB supports the storage of documents in a JSON-like format, has a sufficiently flexible query language, can create indexes for various stored attributes, efficiently manages large binary objects, supports journaling operations for modifying and adding data to the database, can operate according to the Map/Reduce paradigm, and supports replication and the creation of fault-tolerant configurations.

In the release of FerretDB 0.1.0, the method for extracting data from PostgreSQL has been completely revamped. Previously, for each incoming MongoDB request, a single SQL query was generated for PostgreSQL, utilizing functions to handle JSON formats and performing result filtering on the PostgreSQL side. Due to differences in the semantics of PostgreSQL's json functions and MongoDB, there were discrepancies in behavior when comparing and sorting different types. To address this issue, an excessive data selection is now extracted from PostgreSQL, while result filtering is performed on the FerretDB side, allowing MongoDB behavior to be replicated in most situations.

The price of increased compatibility has been a decrease in performance, which future releases aim to compensate for by selectively filtering only those requests in FerretDB that exhibit behavior discrepancies. For instance, the query "db.collection.find({_id: ‘some-id-value’})" can be fully processed in PostgreSQL. The primary goal of the project at this stage of development is to achieve compatibility with MongoDB, while performance has been put on the back burner for now. Among the functional changes in the new version, support for all bitwise operators, the comparison operator "$eq", as well as the operators "$elemMatch" and "$bitsAllClear" are noted.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster