QueryLeaf: SQL for Mongo
github.com
github.com
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.
create table document (
id uuid primary key default gen_random_uuid(),
doc 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.I also wonder if there are some specific capabilities of MongoDB that this pattern does not support?
Would love to hear from others with more Postgres than I.
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.
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
Let's you interact with Mongo as if it were a regular SQL JDBC database