Live data from Hacker News

A proof of concept MongoDB clone built on Postgres

github.com

11–20 of 51 posts

Re: A proof of concept MongoDB clone built on Postgres

#11

Earlier quoted context omitted.

| MongoDB has interchangeable backends Do you have a source on this? I can't find anything at the moment but it sounds familiar.

The feature is called "pluggable storage engine", if you want something to Google.

Yup, found it: http://docs.mongodb.org/manual/release-notes/3.0/#pluggable-...

Re: A proof of concept MongoDB clone built on Postgres

#15

Something else that provides a simple API for working with JSON in Postgres: https://github.com/robconery/massive-js (node.js)

That looks pretty awesome, although fairly orthogonal to this discussion. I submitted it as a story on its own. https://news.ycombinator.com/item?id=9407782

Re: A proof of concept MongoDB clone built on Postgres

#16
post #2

Why?

I suspect there are lots of people who built applications on top of MongoDB who would like to transition away from Mongo onto a different database, or would at least like the option to be able to to. This may provide a good mechanism for a transition. Which leads to a question for the OP: does this work with mongoose.js?

Could be interessting for meteor.com, the mongodb only usage prevent me to use it.

Re: A proof of concept MongoDB clone built on Postgres

#17
post #7

I was going to post that this would have been cool a year ago, but now that MongoDB has interchangeable backends there's not much to gain from a high level project like this. But then I saw that this project started two years ago, and the last commit was a year ago.

From my experience of MySQL's pluggable engines, I learned that this actually complicates things: the user interface ends up being awkward, optimization is harder, adding features is made much harder.

Investigating standalone alternatives therefore seems like a good thing, even for projects starting today.

Re: A proof of concept MongoDB clone built on Postgres

#19
post #6

How are JSON updates handled? For those who aren't aware, Postgres currently lacks support for doing updates to JSON fields via SQL[1]. For many this isn't a problem, but I'd imagine that people expecting a MongoDB clone would need it. [1] But even though you can individually address the various fields within the JSON document, you can’t update a single field. Well, actually you can, but by extracting the entire JSON…

Write a function in PLV8?

Or Python, or any language that has a PL in PostgreSQL. Unfortunately a lot of people consider that a hack, and they're not wrong.

If we can address fields with operators (->, ->>, etc.) then why can't those operators modify, too? It works for everything else, after all. It's fairly counter-intuitive from a dev perspective.

That, and PLV8 still doesn't support JSONB. With JSONB being so much more efficient, faster, and so on, not being able to interact with it using the most logical procedural language is an EPIC oversight.

Post reply on HN