I am skeptical that SQL with Mongo backing it would be at all performant except in the most trivial cases. On the flip side, Postgres's jsonb indexing makes the inverse very doable.
We're seeing a convergence of document DBs adding relational features, and relational DBs adding document features. At this point I find the best of both worlds to simply be PG with JSONB.
Maybe not capabilities, but I'm wondering if Postgres has gotten any easier to scale horizontally. The administrative overhead of scaling and maintenance with MongoDB seemed lower to Postgres to me.
Would love to hear from others with more Postgres than I.
Excluding conversations about MongoDB compatibility, PG16 added bidirectional replication for multiple writers and there are Postgres-compatible options out there for a distributed database including Citus, EDB Postgres Distributed, Yugabyte, CockroachDB, Aurora Limitless, etc.
The choices require some nuance to figure out a best fit, but then again so does any MongoDB installation (despite the marketing hype to the contrary as there are no free lunches).
You might be surprised how far most folks can typically scale with just read replica(s) on a reasonably sized writer. Add in bidirectional replication for multiple writers, and you can go even further. Beyond that, even vanilla Postgres can do it, but you'll need to do some combinations of partitioning and foreign tables.
I can appreciate the technical aspect of a translation layer, but I struggle to understand the use case for a tool like this. If your data is inherently relational, then you should be using a relational store anyway. And if it isn't, trying to hammer it on-demand into something that looks relational is going to eat you with performance implications. Unless I'm missing something.
Honestly, putting Mongo and SQL together always confuses me a bit. I'm way more comfy with Postgres and jsonb. Anyone else feel like scaling Postgres is still kinda a pain?
Would much rather have "Mongo" for SQL like this:
https://github.com/microsoft/documentdb
I am skeptical that SQL with Mongo backing it would be at all performant except in the most trivial cases. On the flip side, Postgres's jsonb indexing makes the inverse very doable.
FerretDB v2 is built on top of this extension. See https://github.com/FerretDB/FerretDB
We're seeing a convergence of document DBs adding relational features, and relational DBs adding document features. At this point I find the best of both worlds to simply be PG with JSONB.
This alone will give you a huge number of the features that Mongo provides, but also the full power of Postgres for everything else.this makes so much sense.
I also wonder if there are some specific capabilities of MongoDB that this pattern does not support?
Maybe not capabilities, but I'm wondering if Postgres has gotten any easier to scale horizontally. The administrative overhead of scaling and maintenance with MongoDB seemed lower to Postgres to me.
Would love to hear from others with more Postgres than I.
Excluding conversations about MongoDB compatibility, PG16 added bidirectional replication for multiple writers and there are Postgres-compatible options out there for a distributed database including Citus, EDB Postgres Distributed, Yugabyte, CockroachDB, Aurora Limitless, etc.
The choices require some nuance to figure out a best fit, but then again so does any MongoDB installation (despite the marketing hype to the contrary as there are no free lunches).
You might be surprised how far most folks can typically scale with just read replica(s) on a reasonably sized writer. Add in bidirectional replication for multiple writers, and you can go even further. Beyond that, even vanilla Postgres can do it, but you'll need to do some combinations of partitioning and foreign tables.
https://www.ferretdb.com/
Curious if there is something similar that works with sqlite.
There is FerretDB v1, which provides MongoDB protocol for SQLite. See https://github.com/FerretDB/FerretDB/tree/main-v1
They seemed to have moved away from that.
From https://docs.ferretdb.io/migration/migrating-from-v1
> Unlike v1.x that provides options for PostgreSQL and SQLite as backend, FerretDB v2.x requires a PostgreSQL with DocumentDB extension as the backend
As of 3.38 (or 3.45 if you meant a binary JSON structure specifically) https://sqlite.org/json1.html
We can use json type, but the dx around directly using that is not comparable to mongodb. Which is why I was looking for a similar abstraction.
I can appreciate the technical aspect of a translation layer, but I struggle to understand the use case for a tool like this. If your data is inherently relational, then you should be using a relational store anyway. And if it isn't, trying to hammer it on-demand into something that looks relational is going to eat you with performance implications. Unless I'm missing something.
It's somewhat of a secret, but AWS's JDBC driver for DocumentDB supports Mongo as well
Let's you interact with Mongo as if it were a regular SQL JDBC database
https://github.com/aws/amazon-documentdb-jdbc-driver
That driver is read-only
Honestly, putting Mongo and SQL together always confuses me a bit. I'm way more comfy with Postgres and jsonb. Anyone else feel like scaling Postgres is still kinda a pain?
[dead]