19 ms·
"MangoDB is a proxy which uses PostgreSQL as a backend. The proxy translates MongoDB wire protocol commands into SQL queries, and use PostgreSQL as storage." Y
by throwaway20371 5y ago
"MangoDB is a proxy which uses PostgreSQL as a backend. The proxy translates MongoDB wire protocol commands into SQL queries, and use PostgreSQL as storage."
You don't have to support MongoDB, but you can support apps that were only written with Mongo as backend? That's awesome. I can't imagine it's production-ready yet but it's a great idea.
- christkv 5y agoThere was another thing in that space aswell https://www.torodb.com https://www.torodb.com
- kumarvvr 5y agoI have seen multiple benchmarks that show PostgreSQL has better performance than Mongo in almost all use cases. A simple wrapper in a language like Go or Rust is sufficient to surpass Mongo performance. Personally, I have shifted database operations behind a GRPC service that uses Go language and PostgreSQL back-end. Allows me to customize the data store to suit the requirement. PostgreSQL does not get enough love in this world.
- rustnote 5y agoIt's plenty loved, I'd say the most loved, but still a fair way behind Oracle in terms of popularity just because of legacy stuff. Damn legacy code, hecking JQuery was still the most used JS framework until just this year!
- kumarvvr 5y ago> but still a fair way behind Oracle in terms of popularity I have a vague feeling that those who use Oracle are using it due to circumstance or corporate necessity.
- strictfp 5y agoOracle is a hot mess but it also has some really powerful features, like table sharding , that actually works if you manage to set it up correctly.
- pydry 5y agoOne of the last straws for a job I had once was realizing that the oracle python client would convert money fields into float. Oracle had its tentacles everywhere in that company. I think even they wanted to stop using it but it was just integrated to too much.
- kvdveer 5y agoOracle and popularity don't really go together. Oracle is really common, just like root-canal treatments. Wouldn't refer to either as popular, though.
- keyle 5y agoTo be clear, Oracle's popularity isn't popularity in the sense of popular folk love. Unless you mean popularity in the most rancid disgust available en masse.
- SergeAx 5y ago> in almost all use cases Including horizontal sharding and vertical replication out of the box?
- kumarvvr 5y agoIt has both, but not out of the box.
- exelib 5y agoMore info?
- robertlagrant 5y agoWhat's vertical replication?
- deleted 5y ago[deleted]
- SergeAx 5y agoHaving several read-only replicas in every shard to distribute reading load.
- mst 5y agoI've seen quite a few instances where a mongo deployment using both of those can comfortably be replaced by a single postgres primary (on about the same hardware as a single member of the mongo cluster) with a couple of read replicas and a connection balancer. There are absolutely mongodb deployments out there that are at sufficient scale that they genuinely need those features in any storage backend, but I suspect the vast majority of them only need those features to work around mongo's mediocre straight line performance. How close this comes to counting as "almost all" is of course highly arguable.
- SergeAx 5y ago> can comfortably be replaced by a single postgres primary And lose all the data in a single failure?
- irq-1 5y agoOff topic. What would you think of a 1 to 1 relation between gRPC functions and stored procedures? Keeping all the SQL together inside postgres is great for debugging and updates; you can see all dependencies. One to one would stop you from having to make a different API, and make the gateway a simple reusable service.
- michaelpb 5y agoYeah, I could imagine this being a useful step to migrate away from MongoDB. I suspect there are plenty of "resume-driven development" MongoDB installations out there that could use something like this.
- threeseed 5y agoMongoDB is a 12 year old database. And yet people are still using this disparaging argument that anyone that chooses it is doing so for their resume and not because it meets their needs in any way. But by all means replace your production system with MangoDB which is unsupported, significantly slower, has no built-in HA/clustering and written in Go which is a GC language.
- zitterbewegung 5y agoI agree either stay with mongodb or if you really want to migrate then just switch to Postgres by obviously exporting the data and putting it into Postgres
- michaelpb 5y agoHm, well, I never said that ANYONE who uses MongoDB is guilty of resume driven development. I specifically only indicated the ones that WERE chosen via resume driven development. Unless you were replying to the wrong comment?
- threeseed 5y agoNo I am replying to the right comment. I think it's disparaging to use the term resume driven development as though there is a large class of developers who are actively trying to harm projects by selecting inappropriate technologies. I've worked with thousands of developers over the last 20+ years and never seen anyone do this.
- mapcars 5y agoSince you haven't seen it means it doesn't happen? Sad that 20+ years didn't teach you basics of logic.
- taf2 5y agoDidn't the stripe team do something like this 5 or 10 years ago? I seem to remember them having a translation layer or doing some sort of streaming conversion from mongodb to pg? Ah yes - https://github.com/stripe-archive/mosql https://github.com/stripe-archive/mosql 6 years ago
- PeterZaitsev 5y agoDoes not look like the same thing - this looks like system to replicate from MongoDB rather than being able to talk to PostgreSQL as if it were MongoDB
- tyingq 5y agoYes, that seems correct "MoSQL imports the contents of your MongoDB database cluster into a PostgreSQL instance, using an oplog tailer to keep the SQL mirror live up-to-date. This lets you run production services against a MongoDB database, and then run offline analytics or reporting using the full power of SQL."
- jerrysievert 5y agoI did something similar for fun 8-9 years ago as well: https://github.com/jerrysievert/mongolike https://github.com/jerrysievert/mongolike at the time it was much faster than native mongo.
- sitkack 5y agoThis also means you don't have to use PostgreSQL, you are using its wire protocol. So ideally, this could work with Cockroach, Yugabyte, Cloud Spanner, Crate DB, immudb and tens of others that I am missing.
- deleted 5y ago[deleted]
- inkyoto 5y ago> You don't have to support MongoDB, but you can support apps that were only written with Mongo as backend? That's awesome. I can't imagine it's production-ready yet but it's a great idea. You have just described AWS DocumentDB, which is a Mongo compatible frontend using Postgres as the backend (AWS coyly refer to it as Aurora, though); the wire protocol compatibility is at the version 4.0 level, with some extras thrown in. Change event streams also works like a charm. We have been using it for a couple of years and have found DocumentDB stable, performant with the AWS support being very good. Support for complex compound indices is still missing as well as support for complex query projections is somewhat missing, but we have decided to change ways of how we use use documents instead, so it has not become a major impediment for us. The main disadvantage, though, is cost, especially for smaller datasets where spinning up a separate DocumentDB cluster quickly turns into a money wasting excercise. Although, for our primary use cases, DocumentDB is still more than 3x cheaper than a comparable Atlas MongoDB PaaS.
- julianlam 5y agoExcept DocDB is not a drop-in replacement despite what Amazon says. People have tried and failed to get our software running on DocumentDB, whereas another developer got it running on CosmosDB with minimal changes upstream. Not affiliated with MS in any way, just sharing what I've witnessed secondhand.
- inkyoto 5y agoAmazon do not say that DocumentDB is a drop-in replacement, neither do I. Moreover, I have outlined specific incompatibilites between Mongo and DocumentDB we have encountered for our use cases; RBAC controlled document filtering is not available in DocumentDB, either. Therefore, it won't suit everybody. However, for simple to medium complexity projects, especially for brand new ones, DocumentDB is a viable and a more affordable alternative to Atlas MongoDB with a decent level compatibility.