Set out to become the de facto open-source alternative to MongoDB

MangoDB

MangoDB is set out to become the de facto open-source alternative to MongoDB. MangoDB is an open-source proxy, which converts MongoDB wire protocol queries to SQL, and uses PostgreSQL as a database engine.

Why do we need MangoDB?

MongoDB is a life-changing technology for many developers, empowering them to build applications faster than using relational databases. Its easy to use and well documented drivers makes MongoDB one of the easiest to use database solutions avaliable. However, MongoDB abandoned its open source roots, changing the license to SSPL - making it unusable for many open source and commercial projects.

Most MongoDB users are not in need of many of the advanced features offered by MongoDB, however, they are in the need of an open-source database solution. Recognizing this, MangoDB is here to fill the gap by providing an alternative.

Scope

MangoDB will be compatible with MongoDB drivers and will work as a drop-in replacement for MongoDB in many cases.

Current state

What you are seeing here is a tech demo, intended to show a proof of concept. Over the next couple of months we will be working on adding more see this example for a short demonstration.

MangoDB is in a very early stage and welcomes all contributors. See CONTRIBUTING.md.

Contact us

Visit us at www.mangodb.io, get in touch, and sign up for updates on the project.

Owner
MangoDB
A truly Open Source MongoDB alternative
MangoDB
Comments
  • Add `saslStart` stub

    Add `saslStart` stub

    Description

    Closes #1593.

    We cannot enable authorization to run both FerretDB and MongoDB with PLAIN authorization mechanism because it is not available for MongoDB. Implemented stub was tested locally with FerretDB. To test it locally you need:

    • checkout into this branch;
    • execute bin/task run
    • execute in another terminal docker compose exec mongodb mongosh 'mongodb://username:[email protected]:27018/test?tls=true&tlsCAFile=/etc/certs/rootCA.pem&heartbeatFrequencyMS=300000&authMechanism=PLAIN'

    In the FerretDB output check for the saslStart string. FerretDB will respond with ok, MongoDB will respond with MechanismUnavailable error.

    Readiness checklist

    • [ ] I added tests for new functionality or bugfixes.
    • [x] I ran task all, and it passed.
    • [x] I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
    • [ ] I checked comments rendering with task godocs.
    • [x] I ensured that the title is good enough for the changelog.
    • [x] (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
    • [x] I marked all done items in this checklist.
  • Add documentation for embedded/nested documents query

    Add documentation for embedded/nested documents query

    Description

    Closes #1310.

    Readiness checklist

    • [ ] I added tests for new functionality or bugfixes.
    • [ ] I ran task all, and it passed.
    • [ ] I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
    • [ ] I checked comments rendering with task godocs.
    • [x] I ensured that the title is good enough for the changelog.
    • [x] (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
    • [x] I marked all done items in this checklist.
  • Implement `MsgDataSize` for Tigris

    Implement `MsgDataSize` for Tigris

    Description

    This PR closes #773.

    Readiness checklist

    • [x] I added tests for new functionality or bugfixes.
    • [x] I ran task all, and it passed.
    • [x] I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
    • [ ] I checked comments rendering with task godocs.
    • [ ] (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
    • [ ] I marked all done items in this checklist.
  • support multiple modules for linters

    support multiple modules for linters

    Description

    This PR closes #557 .

    Run linters in all modules except tools (., ./integration)

    Readiness checklist

    • [ ] I added tests for new functionality or bugfixes.
    • [ ] I ran task all, and it passed.
    • [ ] I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
    • [ ] I checked comments rendering with task godocs.
    • [ ] (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
    • [ ] I marked all done items in this checklist.
  • Support `ordered` argument for `delete` command

    Support `ordered` argument for `delete` command

    Description

    This PR closes #848.

    Readiness checklist

    • [x] I added tests for new functionality or bugfixes.
    • [x] I ran task all, and it passed.
    • [x] I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
    • [ ] I checked comments rendering with task godocs.
    • [x] (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
    • [x] I marked all done items in this checklist.
  • Support simple query pushdown

    Support simple query pushdown

    Description

    This is analysis PR for #2, we won't merge it. Select queries of the form {_id: <value>}. PR scope is {_id: <value>} where <value> is ObjectID.

    Tigris

    TODO: How will we ensure that Tigris compares values the same way as MongoDB?

    Not in scope

    Other cases when <value> of types are not in scope:

    • Strings
      • string comparison difference between MongoDB and PostgreSQL i.e.
      • case sensitive
      • zero values
      • collation
      • encoding checks
      • etc.
    • Binary data
      • len
      • sub-type
      • byte by byte
    • Numeric
    • Dates and Timestamps
      • ordering
    • Non-existent Fields (NaN, Inf)
    • Objects
    • Arrays
      • arrays are restricted to be in _id

    Links

    The pushdown term. MongoDB restrictions on _id. MongoDB Comparison/Sort Order.

  • Implement `debugError` command

    Implement `debugError` command

    Description

    Closes #640.

    Readiness checklist

    • [ ] I added tests for new functionality or bugfixes.
    • [ ] I ran task all, and it passed.
    • [ ] I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
    • [ ] I checked comments rendering with task godocs.
    • [x] I ensured that the title is good enough for the changelog.
    • [x] (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
    • [x] I marked all done items in this checklist.
  • Add documents validation to `wire` package

    Add documents validation to `wire` package

    Description

    Closes #1151.

    Readiness checklist

    • [x] I added tests for new functionality or bugfixes.
    • [ ] I ran task all, and it passed.
    • [x] I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
    • [ ] I checked comments rendering with task godocs.
    • [x] I ensured that the title is good enough for the changelog.
    • [x] (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
    • [x] I marked all done items in this checklist.
  • Fix issues for the Unix listener

    Fix issues for the Unix listener

    Description

    Closes #1295.

    • test-integration-pg runs on unix socket, -target-unix-socket is already specified in Taskfile.yml.
    • We don't support unix socket on windows, windows always uses TCP.

    Readiness checklist

    • [ ] I added tests for new functionality or bugfixes.
    • [x] I ran task all, and it passed.
    • [x] I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
    • [ ] I checked comments rendering with task godocs.
    • [x] I ensured that the title is good enough for the changelog.
    • [x] (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
    • [x] I marked all done items in this checklist.
  • Implement ListDatabases command.

    Implement ListDatabases command.

    Had a quick shot at the issue mentioned in #61 - It's not complete but I thought I'd just put it up so you could have a look and point me in the right direction in terms of how I'm approaching it! Still learning a bit about pgx, postgres and mongo.

    Are there any examples so far I could look at to begin getting a feel for how to go abouts this? And also how about the testing.

    Sorry if it's a bit lame, thanks though!

  • Add `InTransactionRetry` helper

    Add `InTransactionRetry` helper

    Final Design Deicsion

    • [x] Retry parameters maxRetries, delay are constants
    • [x] Context should only be checked in inTransaction (no need to check it in InTransactioRetry)
    • [x] ctxutil.Sleep(ctx, delay) should be used for delays between attempts
    • [x] transactionConflictError should wrap the original error
    • [ ] ~lazyerror should be used for errors that are not expected / couldn't be processed~ inTransaction already wraps everything in lazyError.

    Initital Proposal (draft, might not compile)

    Implement InTransactionRetry function that would use InTransaction with the given retry in case the transaction failed.

    Details: In principle, we need to retry the transaction only if there is a pgerrcode.UniqueViolation, pgerrcode.DuplicateObject, or a similar error.

    We can define a special error to be returned in such cases. For example, an error could be something like:

    // errTransactionConflict is returned when one of the queries in the transaction returned an error because
    // of an unexpected conflict. The caller could retry such a transaction.
    var errTransactionConflict = fmt.Errorf("transaction can't continue due to a conflict")
    

    And then InTransactionRetry would be something like:

    func (pgPool *Pool) InTransactionRetry(ctx context.Context, f func(pgx.Tx) error, maxRetries int, delay time.Duration) (err error) {
    	for retry := 0; retry < maxRetries; retry++ {
    
    		// TODO: Maybe check if context is done  
    
    		err := pgPool.InTransaction(ctx, f)
    
    		switch {
    		case err == nil:
    			return nil
    		case errors.Is(err, errTransactionConflict):
    			time.Sleep(delay)
    		default:
    			return err
    		}
    	}
    }
    

    With that, the places where we check for pg errors could be like:

    	switch pgErr.Code {
    	case pgerrcode.UniqueViolation, pgerrcode.DuplicateObject:
    		// https://www.postgresql.org/message-id/CA+TgmoZAdYVtwBfp1FL2sMZbiHCWT4UPrzRLNnX1Nb30Ku3-gg@mail.gmail.com
    		return errTransactionConflict
    	default:
    		return lazyerrors.Error(err)
    	}
    

    Definition of done

    • [x] Implement InTransactionRetry
    • [x] Modify at least one handler (for example, msg_insert) to use InTransactionRetry in case of a pg conflict for CreateCollectionIfNotExist
    • [x] Find places where we should use InTransactionRetry and create issue for them
  • Fix inserts of documents without `_id`s

    Fix inserts of documents without `_id`s

    What should be done?

    When an empty document bson.D{} is inserted through collection.InsertOne() or collection.InsertMany(), the driver itself sets a new unique _id for such a document.

    However, if such a document is inserted through db.RunCommand(), a unique _id is not set.

    In this case, FerretDB behaves differently than MongoDB: MongoDB inserts a doc and assigns an _id, and FerretDB returns an error.

    We need to fix it.

    Where?

    See the issue mentioned in the skipped InsertEmpty test - https://github.com/FerretDB/FerretDB/pull/1673/files. Remove "skipped" and run the test to see the difference between MongoDB and FerretDB.

    Definition of Done

    • compatibility test unskipped.
  • Update building documentation

    Update building documentation

    Description

    Closes #735. Closes #1447.

    Readiness checklist

    • [ ] I added unit tests for new functionality or bug fixes.
    • [ ] I added integration tests for new functionality or bug fixes.
    • [ ] I added compatibility tests for new functionality or bug fixes.
    • [x] I made spot refactorings.
    • [x] I updated user documentation.
    • [x] I ran task all, and it passed.
    • [x] I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
    • [x] I checked comments rendering with task godocs.
    • [x] I ensured that the title is good enough for the changelog.
    • [x] (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
    • [x] I marked all done items in this checklist.
  • Validate the client's TLS certificate

    Validate the client's TLS certificate

    What should be done?

    It should be possible to configure FerretDB to validate the client's certificates against the given CA certificate and reject connections without valid certificates. See https://www.mongodb.com/docs/manual/tutorial/configure-ssl/#set-up-mongod-and-mongos-with-client-certificate-validation. Standard go library should be enough for that

    Where?

    https://github.com/FerretDB/FerretDB/blob/main/internal/clientconn/listener.go

    Definition of Done

    • unit, integration, or compatibility test should added (at least one of them should be possible to do);
    • spot refactorings done;
    • user documentation updated (see #1706).
  • Document CLI flags and environment variables

    Document CLI flags and environment variables

    What should be done?

    Our documentation should provide more information than just --help flag.

    Most importantly:

    • the --mode flag requires some explanation in user documentation, not only in CONTRIBUTING.md;
    • TLS flags should be explained.

    Related: https://ferretdb.slack.com/archives/C049W6E01E0/p1672187174464469

Related tags
CockroachDB - the open source, cloud-native distributed SQL database.
CockroachDB - the open source, cloud-native distributed SQL database.

CockroachDB is a cloud-native SQL database for building global, scalable cloud services that survive disasters. What is CockroachDB? Docs Quickstart C

Jan 2, 2023
TiDB is an open source distributed HTAP database compatible with the MySQL protocol
TiDB is an open source distributed HTAP database compatible with the MySQL protocol

Slack Channel Twitter: @PingCAP Reddit Mailing list: lists.tidb.io For support, please contact PingCAP What is TiDB? TiDB ("Ti" stands for Titanium) i

Jan 9, 2023
An open-source graph database
An open-source graph database

Cayley is an open-source database for Linked Data. It is inspired by the graph database behind Google's Knowledge Graph (formerly Freebase). Documenta

Dec 31, 2022
RadonDB is an open source, cloud-native MySQL database for building global, scalable cloud services

OverView RadonDB is an open source, Cloud-native MySQL database for unlimited scalability and performance. What is RadonDB? RadonDB is a cloud-native

Dec 31, 2022
LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability.
LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability.

LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability. LinDB stores all monitoring data of ELEME Inc, there is 88TB incremental writes per day and 2.7PB total raw data.

Jan 1, 2023
This is a mongodb data comparison tool.

mongo-compare This is a mongodb data comparison tool. In the mongodb official tools, mongodb officially provides a series of tools such as mongodump,

Sep 13, 2022
Walrus - Fast, Secure and Reliable System Backup, Set up in Minutes.
Walrus - Fast, Secure and Reliable System Backup, Set up in Minutes.

Walrus is a fast, secure and reliable backup system suitable for modern infrastructure. With walrus, you can backup services like MySQL, PostgreSQL, Redis, etcd or a complete directory with a short interval and low overhead. It supports AWS S3, digitalocean spaces and any S3-compatible object storage service.

Jan 5, 2023
SigNoz helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc. 🔥 🖥. 👉 Open source Application Performance Monitoring (APM) & Observability tool
SigNoz helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc. 🔥 🖥.   👉  Open source Application Performance Monitoring (APM) & Observability tool

Monitor your applications and troubleshoot problems in your deployed applications, an open-source alternative to DataDog, New Relic, etc. Documentatio

Sep 24, 2021
A truly Open Source MongoDB alternative

FerretDB FerretDB (previously MangoDB) was founded to become the de-facto open-source substitute to MongoDB. FerretDB is an open-source proxy, convert

Jan 2, 2023
Blog-mongodb - this repository for educational purpose, learn how to use mongodb and use mongodb with go

ENDPOINT ENDPOINT METHOD ACCESS /register POST all /login POST all /articles GET all /articles POST all /articles/{articleId} GET all /articles/{artic

Jan 4, 2022
gout to become the Swiss Army Knife of the http client @^^@---> gout 是http client领域的瑞士军刀,小巧,强大,犀利。具体用法可看文档,如使用迷惑或者API用得不爽都可提issues
gout to become the Swiss Army Knife of the http client @^^@--->  gout 是http client领域的瑞士军刀,小巧,强大,犀利。具体用法可看文档,如使用迷惑或者API用得不爽都可提issues

gout gout 是go写的http 客户端,为提高工作效率而开发 构架 feature 支持设置 GET/PUT/DELETE/PATH/HEAD/OPTIONS 支持设置请求 http header(可传 struct,map,array,slice 等类型) 支持设置 URL query(可

Dec 29, 2022
gathering distributed key-value datastores to become a cluster

go-ds-cluster gathering distributed key-value datastores to become a cluster About The Project This project is going to implement go-datastore in a fo

Aug 19, 2022
In 'n Out - See what goes in and comes out of PEs/DLLs

In 'n Out Parse and return PE information ino -v comsvcs.dll { "Name": "<string>", "Path": "<string>", "Type": "<string file|directory>", "Im

Dec 16, 2022
Find out where you fall on the Open-Source Character Alignment Chart

gitaligned Find out where you fall on the Open-Source Character Alignment Chart Binaries available in releases. If you prefer to install from source,

Dec 28, 2022
An open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developersAn open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developers
An open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developersAn open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developers

Developer-oriented Continuous Delivery Product ⁣ English | 简体中文 Table of Contents Zadig Table of Contents What is Zadig Quick start How to use? How to

Oct 19, 2021
Focalboard is an open source, self-hosted alternative to Trello, Notion, and Asana.
Focalboard is an open source, self-hosted alternative to Trello, Notion, and Asana.

Focalboard Like what you see? ?? Give us a GitHub Star! ⭐ Focalboard is an open source, self-hosted alternative to Trello, Notion, and Asana. It helps

Jan 9, 2023
The open source public cloud platform. An AWS alternative for the next generation of developers.
The open source public cloud platform. An AWS alternative for the next generation of developers.

M3O M3O is an open source public cloud platform. We are building an AWS alternative for the next generation of developers. Overview AWS was a first ge

Jan 2, 2023
An open source alternative to terraform enterprise.
An open source alternative to terraform enterprise.

oTF An open source alternative to terraform enterprise. Functionality is currently limited: Remote execution mode (plans and applies run remotely) Sta

Jan 2, 2023
Go-mongodb - Practice Go with MongoDB because why not

Practice Mongo DB with Go Because why not. Dependencies gin-gonic go mongodb dri

Jan 5, 2022
Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.
Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.

Tagify Gets STDIN, file or HTTP address as an input and returns a list of most popular words ordered by popularity as an output. More info about what

Dec 19, 2022