Live data from Hacker News

“MongoDB is dead. Long live Postgresql”

github.com

11–20 of 160 posts

Re: “MongoDB is dead. Long live Postgresql”

#11
post #6
post #2

I'm nearly sure one day someone will write a MongoDB compatibility layer on top of PostgreSQL

Not exactly what you were looking for, but you can connect from PostgreSQL to MongoDB via Foreign Data Wrappers - https://github.com/citusdata/mongo_fdw

I know about Foreign Data Wrappers and use them extensively. To clarify, what I want is to have a quick engine swap for some legacy apps without touching anything but config files.

Re: “MongoDB is dead. Long live Postgresql”

#12
post #4

Earlier quoted context omitted.

That's sensible when you consider that postgresql used to be a SQL layer over postgres. Not sure if that is the case now.

> That's sensible when you consider that postgresql used to be a SQL layer over postgres. Were they ever actually separate layers? I thought that PostgreSQL was a rename of Postgres that happened shortly (one-two versions) after they swapped query languages from the Ingres-derived QUEL to SQL.

Postgres95 had both if I remember. Sorry was nearly 20 years ago now - bit rusty :)

Re: “MongoDB is dead. Long live Postgresql”

#14
post #6

Earlier quoted context omitted.

Not exactly what you were looking for, but you can connect from PostgreSQL to MongoDB via Foreign Data Wrappers - https://github.com/citusdata/mongo_fdw

I know about Foreign Data Wrappers and use them extensively. To clarify, what I want is to have a quick engine swap for some legacy apps without touching anything but config files.

Haha, did you just refer to Mongo in the context of legacy apps? I feel old and tired, and we're not even 10 years into this....

Re: “MongoDB is dead. Long live Postgresql”

#15
post #12

Earlier quoted context omitted.

> That's sensible when you consider that postgresql used to be a SQL layer over postgres. Were they ever actually separate layers? I thought that PostgreSQL was a rename of Postgres that happened shortly (one-two versions) after they swapped query languages from the Ingres-derived QUEL to SQL.

Postgres95 had both if I remember. Sorry was nearly 20 years ago now - bit rusty :)

[deleted]

Re: “MongoDB is dead. Long live Postgresql”

#16
post #3
post #2

I'm nearly sure one day someone will write a MongoDB compatibility layer on top of PostgreSQL

PostgreSQL has native json support now. What else is missing? Just a protocol implementation? I'd love to see MongoDB give up and become a PostgreSQL consultancy. Everybody I talk to in the field has the exact same Mongo story: "We love JSON! We use JSON everywhere! We just wanted a DB with native JSON support. We didn't look at the implementation details. We only looked at their marketing. Now we wake up at 3am to f…

> What else is missing? Just a protocol implementation?

Yes. Actually that's why I said that I'm nearly sure.

As a side note: We may also need some rumors on being "web scale" (Actually I don't even know much about the events/comments/whatever which lead to that famous video but I still find it funny)

Re: “MongoDB is dead. Long live Postgresql”

#17
post #14

Earlier quoted context omitted.

I know about Foreign Data Wrappers and use them extensively. To clarify, what I want is to have a quick engine swap for some legacy apps without touching anything but config files.

Haha, did you just refer to Mongo in the context of legacy apps? I feel old and tired, and we're not even 10 years into this....

Well, I guess "legacy" doesn't always mean "old" - not that I didn't have a weird smile while typing that particular word.

Re: “MongoDB is dead. Long live Postgresql”

#18
post #3
post #2

I'm nearly sure one day someone will write a MongoDB compatibility layer on top of PostgreSQL

PostgreSQL has native json support now. What else is missing? Just a protocol implementation? I'd love to see MongoDB give up and become a PostgreSQL consultancy. Everybody I talk to in the field has the exact same Mongo story: "We love JSON! We use JSON everywhere! We just wanted a DB with native JSON support. We didn't look at the implementation details. We only looked at their marketing. Now we wake up at 3am to f…

It is probably not as simple as "supports json now". Imagine if HN comments were stored as a JSON document:

    Client A: Read JSON.
    Client B: Read JSON.
    Client A: Append new comment to json document.
    Client B: Append new comment to json document.
    Client A: Save JSON
    Client B: Save JSON
A's comment will get deleted. My understanding is that Mongo DB does have a way to append a record within a document, but Postgres does not.

I am in no way advocating for MongoDB (I dislike it). I am just saying that I understand that MongoDB has much more sophisticated updates capability than Postgres.

Re: “MongoDB is dead. Long live Postgresql”

#19
Seriously, another case of using Mongo incorrectly? I want to believe all the Mongo hate, but I can't because I always find out that the actual problem was one or more of:

* didn't read the manual

* poor schema

* didn't maintain the database (compactions, etc.)

In this case, they hit several:

" Its volume on disk is growing 3-4 times faster than the real volume of data it store;"

They should be doing compactions and are not. Using PostgreSQL does not avoid administration; it simply changes the administration to be done.

"it eats up all the memory without the possibility to limit this"

That's the idea -- that memory isn't actually used though; it's just memory mapping the file. It will swap out for something else that needs the space unless you are actively using all the data, in which case you really are using all your memory. Which is why you should put it on its own server...

"it begins to slow down the application because of frequent disk access"

"Finally we sleep quietly, and don’t fear that mongodb will drive out redis to swap once again."

You should be running Mongo on a server by itself. At the very least, if you're having disk contention issues, don't run it on the same server as your other database.

I'm not sure you always need to read the manual for everything, but for your production database, it's probably worth it.

Post reply on HN