Live data from Hacker News

Why Did So Many Startups Choose MongoDB?

nemil.com

71–80 of 164 posts

Re: Why Did So Many Startups Choose MongoDB?

#71

Earlier quoted context omitted.

My guess... SQL is a lot for newcomers to grasp on top of learning the rest of their stack. The appeal of "no schema" is most likely what gets them as it seems easier than SQL. Simple things at first seem daunting like: constraints, joins, and indexes. What they fail to see is that doing these database level things in the application layer becomes the final level hell and you get to live it. People also undervalue th…

Maybe I'm too old now... but SQL is relational algebra translated into some sort of code/language. I did a lot of SQL & relational algebra for my undergrad databases class [which was about 20 years ago now]. Has SQL/DBs been phased out of CS education? Just genuinely curious...

I graduated from an above average university in the UK in the last 5 years and we had multiple modules covering concepts of relational databases, data warehousing, hands-on MySQL and Oracle including full-stack application projects. There was a lot of Java and little more than a Hello World in C

Re: Why Did So Many Startups Choose MongoDB?

#72

Earlier quoted context omitted.

These PostgreSQL features are relatively recent. The jsonb column type dates back to 9.4, which was released in Dec 2014, less than three years ago. MongoDB had been around for well over five years by that point. There are few applications that need distributed scalability beyond what PostgreSQL can provide, but I'd argue that it's not uncommon to have problems with Oracle scalability, if you don't have deep pockets…

Postgres had hstore for a few years before that which solved similar use cases, but was only key value (no nested objects)

Plus, hstore can only handle strings, so it's actually pretty bad when weighed up against a json-store

Re: Why Did So Many Startups Choose MongoDB?

#73
Reminds me of the keynote DHH gave at RailsConf this year. Despite the stories that we like to tell ourselves about picking the right tool for the job, we're just as prone to chasing the shiny new thing as all the other humans.

Re: Why Did So Many Startups Choose MongoDB?

#74

Mongo succeeded for three reasons: 1. Architecturally is was very familiar to traditional relational systems like MySQL. Meaning classical master/slave, sharding and absolute consistency via locks. 2. Mongo's rise coincided with the rise of NodeJS and continued on the success of Ruby on Rails. 3. Mongo has done a phenomenally fantastic job attracting developers with exceptional documentation and getting started mater…

Not so different in some ways from the rise of MySQL itself.

In point #2 substitute PHP for Node and RoR.

In point #3 just change the name from Mongo to MySQL. MySQL AB was brilliant at getting MySQL into Linux distros. When you came to need a DBMS to go along with PHP chances were you could just type 'mysql' and you would connect to a live DBMS instance on the host.

The 10gen team also imitated the MySQL playbook explicitly with built-in replication and an early lack of focus on ACID properties.

Re: Why Did So Many Startups Choose MongoDB?

#75

Earlier quoted context omitted.

MongoDB is like the PHP of databases. I started programming PHP and currently I bash it every time I can, because it is a terrible language. But it is easy to start and do cool stuff, just like mongodb. Initial traction is more important than initial architecture, I guess.

Why is PHP a terrible language? It powers a vast part of the internet including sites huge, tiny, and everything in between. It's in vogue to hate on PHP especially here on HN. Language hate based on some sort of popularity contest is silly and language snobbery wont be tolerated at any company worth its salt (read: NOT most startups)

It's not "in vogue". There's no trend here, the PHP hate has been very consistent over time.

Personally, having had to write a couple of Mediawiki plugins and an extension for a rubbish CMS called TYPO3, my experience so far is that the PHP hate is very much justified.

Re: Why Did So Many Startups Choose MongoDB?

#76

Earlier quoted context omitted.

Not only that but you can use PostgreSQL as a NoSQL and there are benchmarks showing that it outperforms MongoDB. And if you do not want to commit to either SQL or NoSQL, the PostgreSQL has you covered. You can put a JSONB column in any of your tables to handle the part of your data that is schemaless, and you can still index the data in that JSONB column. There are a very few applications that need distributed scala…

These PostgreSQL features are relatively recent. The jsonb column type dates back to 9.4, which was released in Dec 2014, less than three years ago. MongoDB had been around for well over five years by that point. There are few applications that need distributed scalability beyond what PostgreSQL can provide, but I'd argue that it's not uncommon to have problems with Oracle scalability, if you don't have deep pockets…

Yep, you can't do stuff like update JSON in place until PG 9.5 (without resorting to a crazy regex, that is).

You also do have to think at least a little about your JSON structure given you can't really use an ORM to query JSONB, and the syntax for JSONB is a bit awkward at times.

Re: Why Did So Many Startups Choose MongoDB?

#77

Earlier quoted context omitted.

MongoDB is like the PHP of databases. I started programming PHP and currently I bash it every time I can, because it is a terrible language. But it is easy to start and do cool stuff, just like mongodb. Initial traction is more important than initial architecture, I guess.

Why is PHP a terrible language? It powers a vast part of the internet including sites huge, tiny, and everything in between. It's in vogue to hate on PHP especially here on HN. Language hate based on some sort of popularity contest is silly and language snobbery wont be tolerated at any company worth its salt (read: NOT most startups)

If you don't know, then I can't tell you :P

Seriously, the biggest problem with php is that fundamentally it's a templating language. One thing I've seen with templating libraries in general, is that they are meant to take a template and a data structure and display output based on these 2, but what ends up happening is they end up converging on turing completeness. It starts with the need for some kind of looping structure in the template. And then someone needs some random logic that is easier to do in the template than before the model, and so another feature gets added to the templating engine. And so it goes, things get kind of bolted on, without a grand vision, and you end up with an API that is inconsistent, where the order of inputs is never the same (is the first parameter haystack or needle??).

Also, the basic shape of the code that tends to get written in PHP is heavily influenced by it's being a templating language. PHP applications tend to end up having a lot of code in the template, that should be done before rendering the model. Rather than a sane 2 pass system, where all the data is gathered and the logic handled to produce a simple data structure that is passed to a very simple template, you end up with crazy monstrosities where there's opening and closing tags everywhere. And you render part of the page, then grab some more data, then render some more page, then maybe do a curl to a 3rd party vendor, then render some more of the page, and it's actually very hard to keep switching mental state to match the context of the code you're looking at.

Anyhoooo, you're getting downvoted because there's lots of literature on why PHP is a terrible language. I'm only replying because it's sort of cathartic, since I maintain a wordpress codebase, and any time I have to interact with core, instead of being able to sanely intercept the underlying data, modify it then pass it along in one place, I have to constantly add lots of random hooks in lots of random places to catch the data just before it's being rendered. It's a total mess, and far more complicated than it needs to be (though there is some debate whether this style made it more approachable from a novice plugin development perspective).

Re: Why Did So Many Startups Choose MongoDB?

#79

I think Enterprise folks do not appreciate the flexibility afforded by NoSQL . For my startup I started off on PostGres SQL with Hibernate and it worked great ... until we first met our paying customers. They needed data elements that I had not envisioned and so we ended up doing Schema updates.. again and again . Since we used ORM (hibernate), that also meant new hibernate code generation . After a while this became…

Database migrations are a thing. Many languages' database libraries have built-in or bolt-on schema migration tools for this very purpose.

Re: Why Did So Many Startups Choose MongoDB?

#80

Earlier quoted context omitted.

MongoDB is like the PHP of databases. I started programming PHP and currently I bash it every time I can, because it is a terrible language. But it is easy to start and do cool stuff, just like mongodb. Initial traction is more important than initial architecture, I guess.

Why is PHP a terrible language? It powers a vast part of the internet including sites huge, tiny, and everything in between. It's in vogue to hate on PHP especially here on HN. Language hate based on some sort of popularity contest is silly and language snobbery wont be tolerated at any company worth its salt (read: NOT most startups)

Way back when I started reading HN, one thing that really struck me was seeing PHP discussed in a practical fashion rather than merely bashing it whenever it's mentioned as was the case in Proggit those days (often, the bashers obviously having very little experience building software).

By that time I was doing most of my coding in Ruby and Python, but this businesslike approach to PHP made me realize this is a place where people really get their hands dirty and build things, rather than care about fads.

Things have really changed, the tone & level of discussion here are now very different. Seems like PHP is kind of a canary in the coal mine in that regard.

Post reply on HN