News for hackers. Stuff that matters.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by threeseed on Tuesday November 12, 2013 @03:43AM (#6716552)
Does this offer absolutely anything new ? No.

Is this person objective and well respected ? No.

Does this person understand why MongoDB/MySQL is popular ? No.

Is anyone going to gain anything from this ? No.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by davidw on Tuesday November 12, 2013 @03:59AM (#6716616)
> Is anyone going to gain anything from this ? No.

Well, if it stops someone from using MongoDB without really thinking about whether they ought to, maybe it'll save someone some grief in the future.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by threeseed on Tuesday November 12, 2013 @04:14AM (#6716667)
If this was an intelligent piece analysing the pros/cons of MongoDB and when it would be an optimal choice then I could understand it. But this is the equivalent of blog spam from a guy who is selling a SQL Performance book.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by goldenkey on Tuesday November 12, 2013 @04:19AM (#6716685)
Many articles regarding MongoDBs awful memory mapped simple b-tree data storage method have popped up on HN. Martin is merely talking about the politics of MongoDB; to call his links to polyglot methods and his information blog spam is dishonest to say the least. I thought it was a great post and I bet many other HNers who up voted it feel the same way.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by annnnd on Tuesday November 12, 2013 @05:43AM (#6716984)
> MongoDBs awful memory mapped simple b-tree data storage method

You realise that they are using default kernel implementation? Awful indeed. :)

If you are so anti-MongoDB, would you care to offer an alternative? It must support: - document-like storage (I already have schema on application layer), - simple use / administration, - hot backup, - single node operation.

While this list is mostly outlining why MongoDB is a great DB for my current use case, I am also genuinly interested in better solutions (for that case). So, fire away... :)

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by leif on Tuesday November 12, 2013 @08:10AM (#6717539)
Let's see if I can make your day with a shameless plug.

First of all, using the kernel's paging algorithm for a database is awful. It has way less information about your access patterns than the database, so it's going to make a lot of bad decisions, and a bunch of MongoDB's problems with fragmentation and performance cliffs come from using mmap. It's quick and dirty.

Here's the alternative, and it supports the exact same document storage as MongoDB, the same administration interface, actually the same protocol everywhere, hot backup, and however many nodes you want: TokuMX[1]. It does all those things because it's actually mostly MongoDB, just with the storage engine replaced with an engine that works faster, compresses your data, and has more mature things like document-level locking for writers and better multi-document isolation semantics on a single node. Give it a whirl and let us know if you like it.

[1]: http://www.tokutek.com/products/tokumx-for-mongodb

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by chris_wot on Thursday November 14, 2013 @09:04AM (#6732292)
Why is it called a "fractal tree"?
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by leif on Thursday November 14, 2013 @10:29AM (#6732815)
Marketing. No technical reason.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by chris_wot on Friday November 15, 2013 @05:46AM (#6738721)
From what I can tell, this has been patented, but was implemented in part by Postgres much earlier.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by leif on Friday November 15, 2013 @06:09AM (#6738791)
I promise it hasn't, but I'm curious to see what you're talking about. Link?
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by chris_wot on Friday November 15, 2013 @05:15PM (#6742536)
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by leif on Saturday November 16, 2013 @12:03PM (#6745431)
That thread is talking about the possible inclusion of our indexing library inside Postgres, and was from before we had open sourced the code. IANAL but I think it would be possible to include the fractal tree library in Postgres now if someone wanted to do it, but none of it has ever been implemented by Postgres.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by chris_wot on Saturday November 16, 2013 @09:58PM (#6747342)
I stand corrected! Thanks for the info.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by goldenkey on Tuesday November 12, 2013 @06:16AM (#6717090)
Everything you've mentioned is standard to SQL databases. If you have a schema you don't need NoSQL. Use an ORM for SQL for the language of your choice. Pretty much any db will run as a single node but you should never do that in practice, redundancy is security is stability
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by annnnd on Tuesday November 12, 2013 @07:46AM (#6717427)
> If you have a schema you don't need NoSQL

Sure, but by that argument I don't need SQL either. I am not sure what your point is?

Anyway, the selling point (for me) is that I don't need to find some fancy ways to translate my schema to relational schema. For instance, let's say I have some text content in two languages; in relational DB the texts should probably go to a separate table and I should reference the main record by some foreign key. In document-oriented DBs I can just put both of the texts inside the record... To me that makes much more sense.

But yeah, if you are a hardcore SQL user who is used to normalizing the data until it hurts (as someone else commented) it is difficult to break out of the habit.

And after you eliminate SQL as an alternative (in my case) there are not many options left. At least I couldn't find (m)any.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by goldenkey on Tuesday November 12, 2013 @04:05PM (#6721077)
If you know you are only storing two languages, they can go directly on the parent table, named english_text and spanish_text. If you are talking about the easyness of storing a hashmap in NoSQL, ie: { english :'text', spanish : 'text', french: 'text' }

You can achieve this in the same table with the JSON storage type:

http://www.postgresql.org/docs/devel/static/datatype-json.ht...

Really though, a decent ORM will take care of all the foreign key implementation, and a hashmap is well served by a 2nd table called 'texts' with 3 columns. I can see why you would be opposed to this, because of the extra join but given the right indexes it won't be slow at all.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by Gigablah on Tuesday November 12, 2013 @03:46AM (#6716568)
Is the comment above going to get downvoted? Yes.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by threeseed on Tuesday November 12, 2013 @03:56AM (#6716611)
Of course. Bashing MongoDB is quite the fun past time here on HN.

Having evaluated nearly every database for my own startup I find it extraordinary that there such angst towards a technology. Sure MongoDB has its faults but so does everything and surely competition is good to keep everyone honest. I mean would PostgreSQL really have had HSTORE if MongoDB never existed ?

At least stop rehashing the same tired arguments for everyone's sake.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by pilif on Tuesday November 12, 2013 @04:12AM (#6716659)
> I mean would PostgreSQL really have had HSTORE if MongoDB never existed ?

Yes. The hstore extension was added to postgres in 2006 (commit 642194ba0cdc0aada9c99bf7712fcae5f3ac86d1), though it predates that date by quite a bit.

The first commit to MongoDB was in 2007

But that doesn't really matter. The reason I dislike MongoDB is that it shipped with unsafe defaults for years and caused people to lose data because of that.

For me, the one must-have feature of a database is that it will always allow me to read the data I've written to it (minus hardware defects). A database which can't fulfill that one feature doesn't qualify as a database in my book.

MySQL has issues there (it allows invalid data to be written and then "corrects" it and I've seen it corrupt table and index data multiple times without any evidence of hardware issues) and so does MongoDB (unless you changed the default config).

This has nothing to do with NoSQL vs. SQL (though, personally, I really like the flexibility for querying offered by the relational model) and everything with data integrity.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by threeseed on Tuesday November 12, 2013 @04:23AM (#6716705)
Original HSTORE was simply key/value pairs which has nothing to do with MongoDB. My point was that the popularity of MongoDB likely was a big incentive to add JSON support to PostgreSQL which they did only last year.

http://lwn.net/Articles/497069/

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by Volpe on Tuesday November 12, 2013 @04:32AM (#6716734)
> (unless you changed the default config).

Lamest argument ever... Are you suggesting that the majority of postgres (say) installs are running default config with no changes? Or even better, Oracle?

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by pilif on Tuesday November 12, 2013 @04:41AM (#6716764)
I'm running multiple postgres installs (albeit small ones) in the default config.

Also, the default config of most databases is very conservative: You won't get speed, but you will get safety and it'll run on whatever hardware you throw at it.

Mongo on the other hand came with unsafe defaults and no obvious warning for people to change it. Additionally, after fixing the configuration, you would lose a lot of performance to the point of it being impractical to run mongo in a safe configuration.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by andrewaylett on Tuesday November 12, 2013 @05:20AM (#6716903)
Majority of installs or majority of transactions across all installs? I suspect that the majority of installs are indeed running default configuration, or at least close enough to default that the user wouldn't have looked closely enough to spot the kind of configuration issue being discussed.

Larger installs, which probably do account for the bulk of transactions, are more likely to have been tuned for speed, although probably keeping all of the safety settings at (or above) their defaults. But part of the point here is that in a safe configuration Mongo makes things slower than default.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by chris_wot on Tuesday November 12, 2013 @06:16AM (#6717091)
The reason I dislike MongoDB is that it shipped with unsafe defaults for years and caused people to lose data because of that.

Surely when using any sort of new technology, you'd do some basic research about write concerns, durability, etc. first? If you just lazily adopt a new technology without reading the documentation, that seems like a bit if a recipe for disaster to me...

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by regularfry on Tuesday November 12, 2013 @06:50AM (#6717203)
"Safe by default" is not a revolutionary concept. That's the reason I won't touch Mongo - not because of any specific bug or failing, but because it was designed from the outset without a consideration for what I consider a pretty fundamental engineering principle.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by Gibheer on Tuesday November 12, 2013 @04:04AM (#6716631)
I'm sorry, but the hstore extension is around 3 years longer.

first commit for hstore http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;...

Wikipedia states the first release of mongodb for 2009

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by threeseed on Tuesday November 12, 2013 @04:11AM (#6716653)
Read the commits. That was when it was storing key, value pairs.

HSTORE as most people know it is the JSON/V8 implementation.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by pilif on Tuesday November 12, 2013 @04:24AM (#6716708)
HSTORE still is only storing key, value pairs. Nested HSTORE is something we might get in 9.4. JSON/V8 does allow nesting but doesn't allow indexes for arbitrary value access - something that MongoDB easily does.

So depending on your use-case and the type of documents and queries you are dealing with, neither the current HSTORE implementation nor the current JSON implementation will work for you, while MongoDB's model might.

But the reverse is true too: Some use-cases are highly relational and it would be really painful to do that with MongoDB due to the lack of easy joins (you have to do them in your application logic which means a lot more work as your requirements change).

Pick the right tool for the job.

Me personally, I prefer the immense flexibility for querying a relational data set over the flexibility of not having to deal with schemas. The reason is that it's much easier to change or add an SQL query than it is to re-format and re-duplicate all of my data followed by more or less manually implementing as good query plan in application code whenever the requirements change.

But this is a pure matter of taste.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by simonw on Tuesday November 12, 2013 @04:18AM (#6716680)
"I mean would PostgreSQL really have had HSTORE if MongoDB never existed?"
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by jfb on Tuesday November 12, 2013 @12:41PM (#6719321)
Does your back hurt from moving those goalposts?
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by BadassFractal on Tuesday November 12, 2013 @04:10AM (#6716647)
That's some gorgeous schooling right there, kudos to you sir.
Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by svennek on Tuesday November 12, 2013 @05:38AM (#6716975)
The rehashing of "tired arguments" is usually because the ones receiving it (Mongo-users in this instance) are in love with their technology and just dismisses the issues...

There is a reason that RDBMs with SQL is still alive almost four decades after its inception... it was a quantum leap forward (and still is)

The point is data quality, data durability and flexibility... and performance...

Remember, those who are ignorant of history are doomed to repeat it...

Btw. as others pointed out, HSTORE actually predates MongoDB, but I give you that some of the fire under HSTORE is due to MongoDB's "threat"... As a very happy PostgreSQL user I thank MongoDB for that at least :)

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by wmil on Tuesday November 12, 2013 @05:03AM (#6716844)
> Having evaluated nearly every database for my own startup I find it extraordinary that there such angst towards a technology.

It's a cultural problem. When you go to a web dev meetup you inevitably meet a programmer in their early 20s who thinks SQL is obsolete and Mongo will be everywhere.

The problem is that it's really nothing new -- it's an XML Database using JSON. There are well understood advantages and disadvantages.

It's just frustrating to constantly encounter people who are convinced that it's a silver bullet.

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by svennek on Tuesday November 12, 2013 @05:26AM (#6716933)
I agree wholeheartedly, the value of a strict schema and a (mostly) standardized query format providing a known good strategy to get the result - and a culture of taking care of its customers data's safety - really is the selling point for SQL.

But anything old is not worth doing to some people (luckily reproduction is the oldest human endeavour ever, so hopefully they won't multiply :)

Re:MongoDB is to NoSQL like MySQL to SQL - in the most harmf... by lzman on Tuesday November 12, 2013 @06:00AM (#6717039)
Agreed. The second point definitely after reading his other blog posts. This also applies to the Diaspora coder who blamed MongoDb for her company's problems. And anybody else who's having a relational epiphany.