Reading through this page on MongoDB website it states:

This MongoDB Wire Protocol Specification is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License. You may not use or adapt this material for any commercial purpose, such as to create a commercial database or database-as-a-service offering.

Does this mean that if I want to create a commercial database or opensource database with DAAS offering, I cannot use this message structure, ie this series of 16 bytes?

struct MsgHeader {
    int32   messageLength;
    int32   requestID;
    int32   responseTo;
    int32   opCode;

If they can, how did Amazon get away with it with their DocumentDB? Additionally, FerretDB OSS, that implements MongoDB wire protocol, is licenced under Apache2. Does that mean that I can take FerretDB with its implementation of MongoDB wire protocol and offer as a service?

  • 3
    Related question on Law.SE: law.stackexchange.com/q/82632 . Note also that even if the license applies to the protocol and not just the specification document, copyright laws often contain exceptions for interoperability purposes. No Creative Commons license prohibits me from doing things that I'm allowed to do by law.
    – amon
    Aug 26, 2022 at 11:50

1 Answer 1


The reasoning that FerretDB is relying on in order to "use" the MsgHeader structure and other elements in the wire protocol (without complying with the BY-NC-SA license) is stated in the README.md document of FerretDB:

FerretDB (previously MangoDB) was founded to become the de-facto open-source substitute to MongoDB.


In its early days, its ease-to-use and well-documented drivers made MongoDB one of the simplest database solutions available. However, as time passed, MongoDB abandoned its open-source roots; changing the license to SSPL - making it unusable for many open source and early-stage commercial projects.

So, the developers of FerretDB do not consider it to be an adaptation of MongoDB; they consider it to be a substitute for it.

Does this mean that if I want to create a commercial database or opensource database with DAAS offering, I cannot use this message structure, ie this series of 16 bytes?

In my opinion, "use" in this manner, it is too broad/ambiguous of a word to consider in a copyright license. Even though that word appears in the note at the top of the MongoDB Wire Protocol Specification document, the document also states that the governing license for the specification is the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.

Note that that license governs only the specifications document, not the facts inside it. For the example presented, the fact is that the MsgHeader structure contains 4 32-bit integers representing the message length, request ID, response "To", and opcode. The only copyrightable element would be how that fact is represented in the document.

If you translate that fact into code in the language you're writing, and if there is only one way or only a few ways to express that fact in that language, then that must be excluded from a copyright analysis in my opinion, so I would not consider it to be therefore based on or adapted from the specification, in the copyright sense.

This is all speculation on my part, but here are some other possible ways that the MsgHeader definition may have made its way into the FerretDB implementation (and probably any other software packages that understand this protocol) without it being an adaptation from the Specifications document:

  1. The developers didn't use the above document in their development, but instead used an earlier published version (i.e. before October 2018) from a time when MongoDB's documentation and/or source code were available under an open source license that explicitly allows this particular use.

  2. The developers didn't use the documentation at all, but instead analysed MongoDB's message outputs themselves using protocol analysis tools and developed their own specification of the message header based on that analysis.

  3. The developers did make use the current protocol specification document, but did so in a way that does not require copyright permission. Even though the document says "you may not use this material for any commercial purpose", a document license cannot prevent you from using the document in a way that is otherwise allowed by copyright law.

See also: Can I cleanroom code by myself, if public specifications already exist?

See also: https://law.stackexchange.com/questions/81159/is-this-copyright-infringement/81169

... how did Amazon get away with [implementing the protocol] with their DocumentDB?

I don't know the answer to this. But if the information in the MongoDB Atlas vs. Amazon DocumentDB comparison page is accurate, then it appears as though the Amazon implementation is "based on" (in a functional sense; not in a copyright sense) an earlier version of MongoDB, well before it was changed to the SSPL license.

Note that MongoDB, Inc. also offers so-called "commercial licenses" with special terms. I suppose it's possible that Amazon has a special license from MongoDB, Inc. to put the protocol implementation in their product, but if that were true, then I'd be surprised that MongoDB is publishing the above comparison page in such an unflattering way to Amazon.

  • I don't understand the fact/document distinction you're making when the purported facts are the creative choices the authors made. Is "Darth Vader is the bad guy in Star Wars, a story in which his son, Luke Skywalker fights him" a fact not entitled to copyright protection? Or is it a creative choice fully entitled to it? Every creative choice protected by copyright is also the fact that that creative choice was made, isn't it? What does a story set in the Star Wars universe take from Star Wars but these "facts"? Aug 26, 2022 at 20:52
  • 1
    @DavidSchwartz In copyright law, probably the better terminology is "idea" instead of "fact". That is, whoever wrote that specification had the "idea" to pack 4 pieces of information together as 4 32-bit integers. That "idea" is not protectable, but the expression of the idea is. For the Star Wars example, the idea of a story where the villian is actually the father of the hero is probably not protectable, but the specific expression in Star Wars that involve the specific characters like Darth Vader and Luke Skywalker, is.
    – Brandin
    Aug 27, 2022 at 6:10
  • My instinct as a programmer is that the "struct MsgHeader" example shown in the document is basically the only basic way to express the idea of 4 consecutive 32-bit integers in most programming languages. For Star Wars, however, there are basically unlimited different ways one could write a story about a villian who actually turns out to be the father of the hero.
    – Brandin
    Aug 27, 2022 at 6:13
  • But the choice to use 4 consecutive 32-bit integers for this structure, in that order, for this purpose is one of a basically unlimited number of ways one could create a structure for a purpose. Surely you're not arguing that the entire DB wire protocol is the only basic way to make a DB wire protocol. Aug 27, 2022 at 6:20
  • 1
    @DavidSchwartz For this particular example, I believe it's the only way to write a compatible implementation. To be sure, one should probably try a clean room implementation. Someone who has not seen the specification could use some other means (such as analyzing the protocol traffic examples), and then use that information to build his own specification. I haven't tried this myself, but I suspect that whoever does this will still arrive at a similar result: there appear to be 4 items in the header, they are all 32-bits, and the purpose of them appears to be: length, identifier, and so on.
    – Brandin
    Aug 27, 2022 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.