QueryLeaf: SQL for Mongo

2025-05-0814:272316github.com

SQL for Mongo (in Node JS). Contribute to beekeeper-studio/queryleaf development by creating an account on GitHub.

You can’t perform that action at this time.


Read the original article

Comments

  • By ttfkam 2025-05-0815:534 reply

    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.

    • By VWWHFSfQ 2025-05-1014:231 reply

      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.

          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.

      • By victor106 2025-05-1014:291 reply

        this makes so much sense.

        I also wonder if there are some specific capabilities of MongoDB that this pattern does not support?

        • By etse 2025-05-1015:481 reply

          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.

          • By ttfkam 2025-05-1020:45

            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.

    • By aleksi 2025-05-1016:49

      FerretDB v2 is built on top of this extension. See https://github.com/FerretDB/FerretDB

    • By zareith 2025-05-1014:532 reply

      Curious if there is something similar that works with sqlite.

  • By sparky_ 2025-05-1016:47

    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.

  • By gavinray 2025-05-1015:091 reply

    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

HackerNews