Sunday, February 16, 2025

FerretDB: An True Open-source MongoDB Alternative


While MongoDB gained immense popularity for its ease of use and developer-friendly drivers, its shift towards a proprietary license has raised concerns about licensing complexities, especially for open-source projects and growing commercial ventures.

Enter FerretDB, a truly open-source alternative that offers a seamless transition for teams seeking MongoDB compatibility without the licensing restrictions. FerretDB acts as a smart proxy, translating MongoDB wire protocol queries (versions 5.0 and above) into SQL, leveraging the robust and widely-adopted PostgreSQL database engine with the DocumentDB extension.

MongoDB Protocol (BSON)  <-->  FerretDB  <-->  PostgreSQL (SQL) + DocumentDB Extension

This innovative architecture allows your existing applications, built with any MongoDB driver, to work flawlessly with FerretDB, backed by the power and reliability of PostgreSQL.

Why Choose FerretDB?

Initially, MongoDB disrupted the database world with its flexible document model and ease of integration, becoming a favorite among developers. However, the move to the Server Side Public License (SSPL) introduced licensing ambiguities, making it less appealing for projects prioritizing open-source principles and cost-effectiveness.

FerretDB emerges as the ideal solution for those seeking:

  • Truly Open-Source Document Database: FerretDB is committed to open-source, ensuring freedom from restrictive licenses and fostering community-driven development.
  • MongoDB Protocol Compatibility: Enjoy seamless migration and continued use of your existing MongoDB applications and drivers with minimal code changes.
  • Powered by PostgreSQL: Benefit from PostgreSQL's proven reliability, scalability, and rich feature set, enhanced with document database capabilities via the DocumentDB extension.
  • Simplified DevOps: Leverage your existing PostgreSQL infrastructure and expertise, streamlining deployment and management within your DevOps workflows.
  • Cost-Effective Solution: Reduce licensing costs associated with proprietary databases, especially crucial for startups and open-source initiatives.

How to Install

FerretDB offers straightforward installation on popular Linux distributions. Below are guides for RPM-based and DEB-based systems:

Installation on RPM-based Systems (RHEL, CentOS, Fedora)

For systems like RHEL and CentOS, you can utilize the rpm package manager.

  1. Download the RPM Package: Grab the latest FerretDB .rpm package from the official FerretDB releases page (replace with actual link when available), and rename it to ferretdb.rpm for convenience.

  2. Install FerretDB: Open your terminal and execute the following command:

    Bash
    sudo rpm -i ferretdb.rpm
    
  3. Verify Installation: Confirm successful installation by checking the version:

    Bash
    ferretdb --version
    
  4. Install PostgreSQL: FerretDB relies on PostgreSQL, which needs to be installed separately:

    Bash
    sudo yum install -y postgresql
    

    (Note: For other RPM-based distributions, you might need to adjust the package manager command accordingly.)

  5. Systemd Service: The RPM package includes a systemd unit file for automatic FerretDB startup. Refer to the systemd configuration guide (replace with actual link when available) for advanced configuration options.

Installation on DEB-based Systems (Debian, Ubuntu)

For Debian and Ubuntu distributions, use the dpkg package manager.

  1. Download the DEB Package: Download the latest FerretDB .deb package from the FerretDB releases page (replace with actual link when available) and rename it to ferretdb.deb.

  2. Install FerretDB: Run the installation command in your terminal:

    Bash
    sudo dpkg -i ferretdb.deb
    
  3. Verify Installation: Check the installed version:

    Bash
    ferretdb --version
    
  4. Install PostgreSQL: Install PostgreSQL using apt:

    Bash
    sudo apt update
    sudo apt install -y postgresql
    
  5. Systemd Service: The DEB package also includes a systemd unit for managing FerretDB as a service. Consult the systemd configuration guide (replace with actual link when available) for detailed service configuration.

Conclusion

FerretDB offers a compelling open-source path for teams seeking a document database solution with MongoDB familiarity and PostgreSQL's robust foundation. By eliminating licensing complexities and providing seamless compatibility, FerretDB empowers developers and DevOps professionals to build and deploy applications with greater freedom and efficiency.

Ready to explore the benefits of FerretDB? Visit the official FerretDB website.

0 comments:

Post a Comment