Marketing. Marketing is what MongoDB got right, along with a small helping of being early to market. It's not even the best or most convenient document store, doesn't have the most features, isn't the most secure, doesn't handle high availability the best, they basically got everything just "good enough" (and sometimes not), along with stellar marketing.<p>They marketed their asses off while they iterated to build a document store that was worth the praise they got people to heap on to it.<p>IIRC the acquisition of the wired tiger engine was basically a rewrite, because the previous implementation was just bad. So if the database engine wasn't good, and distribution wasn't good (until later), and schema management wasn't good, and the query language wasn't all that great, what did mongo really get right? Marketing and being early to market/new and shiny at the right time (when everyone was deciding that writing the frontend and the backend in the same language, javascript, was an awesome thing -- which I don't necessarily disagree with).<p>If someone needs a database these days, I always just suggest postgres. if it's good enoguh for reddit (<a href="https://github.com/reddit/reddit/wiki/Architecture-Overview#reddit-the-software" rel="nofollow">https://github.com/reddit/reddit/wiki/Architecture-Overview#...</a>), it's good enough for the next facebook for dogs (unless your problem is completely different then of course you should explore whatever database paradigm fits your problem the best).
The biggest thing MongoDB got right was putting developer first, optimize for initial experience and development speed.<p>Most database systems came from relation theory background and optimize for performance, operations, data safety, but often developer convenience was sacrificed.<p>Did anybody liked writing data migration? Try explaining value of table migration to some Product Manager of early startup :-).<p>You can argue if that's were the right tradeoffs, but that's how MongoDB get a lot of steam.
> SQL is a great language for ad-hoc exploration of data or for building aggregates over data sets. It’s an absolutely miserable language for programmatically accessing data.<p>Disagreed. SQL is great for programmatically accessing data, especially with a good client library like SQLAlchemy. I have a much easier time understanding and, most importantly, debugging SQL than MongoDB's query language.<p>It did not solve the injection issue either, MongoDB injections are a thing[1] and they're much harder to reason about than SQL injections.<p>[1]: <a href="https://www.owasp.org/index.php/Testing_for_NoSQL_injection" rel="nofollow">https://www.owasp.org/index.php/Testing_for_NoSQL_injection</a>
A couple of notes:<p>MongoDB is excellent for design-first rapid agile development when domains are still maturing. This is common in large system redesigns and start-ups.<p>Comparing MongoDB to SQL or relational is pointless. They are tools. Given the right circumstances, both serve a purpose.<p>Relational databases are still necessary for analytics and reporting. (Try using any reporting tool on a schemaless database or a schema that’s a moving target)<p>I would argue that MongoDB is best used for R&D, but once your domains have matured, quickly moving to a relational data store will provide more sustainability.<p>I’ve also started incorporating graph databases into my architecture thinking. You should too.
SQL is most sophisticated language ever built by mankind. It is centuries ahead of the second most productive language. Mix Window Functions, Common Table Expressions, Qube/RollUp, Materialized Views, ... and holy smoke...<p>You should try really hard to be unproductive with SQL and any relational system.
> Querying SQL data involves constructing strings, and then – if you want to avoid SQL injection – successfully lining up placeholders between your pile of strings and your programming language. If you want to insert data, you’ll probably end up constructing the string (?,?,?,?,?,?,?,?) and counting arguments very carefully.<p>Uhm what?<p>At least in .NET+SQL Server land you can give your SQL queries named parameters. If there's a mismatch you'll get an exception saying so...<p>Perhaps this is a problem in some other stack (PHP?)
I'm not convinced about the point of structured operation format.<p>I agree that manually building SQL strings can be cumbersome. But in practice you can use libraries that allow you to easily create them programmatically.<p>The JSON queries of MongoDB on the other hand, while they are simple to use programmatically, they are a pain to use outside of your program, for example for running ad-hoc queries, or generating a report from your data. And there is no library to fix this.
The appeal and the pitfall of JSON is just that it's less broken down than tables.<p>Suppose you built a "contact database," but all it was was the scanned images of people's business cards. You could flip through pages of them, but you can't do searches. But the input is so easy, just scan and save. And the output is likewise easy, just embed the images in a web page.<p>1. Running optical character recognition would be the first step in breaking down these cards into parsable information.<p>2. Converting the text into JSON and storing it in MongoDB would be taking it to the next level.<p>3. Breaking down the JSON into a set of tables would turn it into the most flexible and useful form --- but it's also the most work.<p>You don't have to take all your data all the way to tables. For example, I leave my website log files as text. Grep and awk are usually all I need. I don't usually import them into tables --- although I have a few times for easier analysis!<p>Although you don't have to turn everything into tables, I would say there are several applications out there where the developer should have gone all the way and not stopped at JSON.
Slightly off-topic, but once ActiveRecord(Rails) - always ActiveRecord. After years of developers complaining about SQL DBs being "difficult" and MongoDB allowing to "easily prototype", I still don't get what's hard about working with PostgreSQL if you use something like Rails.
Mongo is one of the few NoSqls to offer "unique" keys. While common in SQL, this is a big differentiator from other NoSqls and allows many use cases that would have otherwise ended up in the SQL world
> The situation is sufficiently untenable that it’s rare to write apps without making use of an ORM or some similar library, creating additional cognitive overhead to using a SQL database, and creating painful impedance mismatches.<p>That's only true if you're using PHP,Python,Javascript or dynamically typed language. Mongo documents don't automatically map to classes in C++ or Java, the impedance mismatch still exists and a data mapper library is still required, just like with RDBMS.
Talking about an easy experience for failover, and horizontally scaling, I recommend taking a look at MemSQL or NuoDB. I think MemSQL did a really nice job in creating a fast bare-bone SQL solution, with an easy to use management interface. <a href="https://docs.memsql.com/operational-manual/v6.0/managing-high-availability/" rel="nofollow">https://docs.memsql.com/operational-manual/v6.0/managing-hig...</a>
Our community began being filled with relatively inexperienced types who treated engineering problems and solutions like a popularity contest. It was suddenly 'smart' to mock it, so they did, barely understanding the basics. In essence a desperate attempt to fill the gaps in their CV.
Meh. If you find yourself mocking, you're probably doing something wrong <i>somewhere</i>
Sorry for the obvious plug, but if one wants solid replication, ACID compliance and a few other 'enterprisey' features, you should try MarkLogic: <a href="https://developer.marklogic.com/products" rel="nofollow">https://developer.marklogic.com/products</a>
I feel like we got a lot more things right ;)
Other than price it would be good to hear, if people agree and what's missing still.