Skip to content(if available)orjump to list(if available)

EdgeDB is now Gel and Postgres is the future

patatero

I've always thought the name EdgeDB is odd since it's not an actual database software and more of a Prisma competitor.

atombender

> PostgreSQL's query planner/optimizer is decidedly state-of-the-art

Postgres's cost-based planner is good, but it's a decidedly 1980s design, predating the famous but also outdated Volcano/Cascades systems (used by Microsoft SQL Server and CockroachDB and others).

So much has happened in the field of query optimization in the last 30 years, very little of which has ended up in Postgres, I think. Postgres has gotten parallel workers and a JIT, but the fundamental design is largely unchanged. It's also quite conservative about adding improvements; other databases has had some variation of index skip scans for ages (Oracle has probably had it for 20 years now, and you can get it through the TimeScale extension), but Postgres is still working on supporting it natively.

The state of the art is arguably Umbra [1], a research project by Thomas Neumann's group at the university of Munich, the successor to HyPer, which is now being commercialized as CedarDB. Their analysis of the Postgres query planner is an interesting read [2].

[1] https://umbra-db.com/

[2] https://www.vldb.org/pvldb/vol9/p204-leis.pdf

RedCrowbar

The paper seems to mostly focus on the quality of cardinality estimation (mostly driven by statistics) which is admittedly one of the frequent sore points in Postgres. There's been some progress in that area though (CREATE STATISTICS being a highlight).

kelseydh

Also there are now databases purpose built for specific domains. E.g. if you are building a financial ledger I would way rather be interfacing with TigerBeetle than scaffolding an application-driven ledger around Postgres. https://tigerbeetle.com/.

If I am scraping giant amounts of data I would run far away from Postgres for other databases like Amazon Redshift.

gshulegaard

These days if you want a PostgreSQL based Data Warehouse both Citus and Timescale are extensions/PostgreSQL based databases I would consider before Redshift.

But even in the 9.4 days (~a decade ago) I was pushing Terabytes worth of analytics data daily through a manually managed Postgres cluster with a team of <=5 (so not that difficult). Since then there have been numerous improvements which make scaling beyond this level even easier (parallel query execution, better predicate push down by the query planner, and declarative partitioning to name a few). Throw something like Citus (extension) into the mix for easy access to clustering and (nearly) transparent table sharding and you can go quite far without reaching for specialized data storage solutions.

1st1

Perhaps. The trouble usually arrives when you need functionality that your specialized database doesn’t have. Then you end up maintaining two databases and spreading your data, business logic, and resources between them. To each their own, though... there are certainly valid use cases for this.

freeamz

Just wonder what is the advantage of Redshift vs using something such as https://github.com/hydradatabase/columnar, if we are already using postgres?

pgmeanspostgres

Postgres is a decent, acceptable _anything_ database.

Bisecant fractal databases like HyperKlingonDB are excellent at storing bisecant fractal data, but terrible at anything else (often, just plain terrible overall due to being immature).

paulryanrogers

How does MySQL compare? I get the sense that innovations land there sooner because of all the mega corps that use it.

re-thc

A lot of the work is now part of MySQL Heatwave, the paid Oracle / cloud edition.

celeryd

> So much has happened in the field of query optimization in the last 30 years, very little of which has ended up in Postgres, I think. Postgres has gotten parallel workers and a JIT, but the fundamental design is largely unchanged.

Guess I'll keep using Postgres.

NetOpWibby

> To oversimplify, Gel to Postgres is what TypeScript is to JavaScript.

I've been using EdgeDB for years (from RethinkDB and MongoDB before that) and it's my favorite database. I don't need to memorize SQL commands and I get a pretty UI to look at my data if my queries introduce issues.

alangou

Tried many ORMs to get them to work in SQL, but EdgeDB's was the one that worked extremely straightforwardly, literally without any issues that weren't due to not following the instructions.

No bugs, no configuration errors, no nothing. It all just worked. So I think you guys deserve more recognition and credit for what is clearly a very well-engineered product that I intend to use for some of my personal projects.

purplerabbit

Have you tried drizzle? If so, what's your beef? (The only one I've had is lack of down-migrations)

alangou

For me, personally, I do a ton of fullstack work in JavaScript-land, but also have Python services for ML-heavy needs, and it’s nice to define one schema that at its root is still SQL while generating query clients for multiple languages.

1st1

Addressing your core question: Drizzle is a great ORM with a tastefully designed API—it's clearly a product of love. But it’s still an ORM, and it’s confined by certain design boundaries that come from being a library. For example, what if you want to use TypeScript, Go, and Python on your backend? Do you run three ORMs, each with different APIs? With Gel, you have one data model and a unified querying layer—the true source of truth.

We have a blog post about that and more [1].

---

By the way, if you visit Drizzle’s website, you’ll see that Gel is one of their biggest sponsors. We worked closely with Drizzle to ship a first-class integration with Gel. You can use Gel’s schema and migrations, and Drizzle will just work. You can even use the Drizzle query builder and EdgeQL side by side if you want.

[1] https://www.geldata.com/blog/a-solution-to-the-sql-vs-orm-di...

valenterry

> Do you run three ORMs, each with different APIs?

Yes and you absolutely have to. That's not a disadvantage, it's just how it is. Because SQL is the absolute bare minimum. The lowest common standard. And not a great one. Null handling and typesystem for example are way inferior to those of good programming languages. So why would I leave those productivity gains on the table?

Using EdgeQL simple means I have another programming language at hand.

> EdgeDB has a robust type system that's most [sic] comprehensive that most ORMs

Well yeah. And it is inferior to the programming language I use. Hence, this comes at a disadvantage to me.

> We've also built a query builder for TypeScript

Aha, so then... why not build a query builder for every language, just like with ORMs?

Sorry, not convinced. We would be better off by improving on SQL itself.

re-thc

Drizzle still lacks a lot of features / stability (bug fixes required).

Hopefully it improves over time.

1st1

Having worked with the core team I can only say that they are amazing. I'm sure they'll figure it out, but database tech is gnarly. Takes time.

hiccuphippo

Ok, but is it gel as in gif or gel as in gif?

RedCrowbar

Gel as in gif obviously! :-)

kelseydh

Postgres is great, but the level of work required to scale it on large workloads is really quite overwhelming. You really need expert-level knowledge to scale it. Just ask anybody who has had to shard their database.

genewitch

I ran a 4000qps postgres database set to use no more than 640KB of RAM (its in the configs).

The DBA was having fun with my silly idea until Slow-Query takes 10 seconds and we flipped back over to the production systems with much more allowed memory for postgres.

My purpose was to show that Linux itself is pretty fast at caching and paging, even if Postgres was hamstrung. The db actually ran fine except for the slow queries, and we probably could have cleaned them up, too. But I proved my point.

DB was ~300GB, metal had 512GB RAM. This was in 2012.

dano

Yep. I converted a business from to Postgres in 2004 and never looked back. Stable, reliable, no surprises. Postgres is the answer until proven otherwise.

asteroidburger

Figured I'd poke at the quickstart a bit, but the github repo linked to from https://docs.geldata.com/learn/quickstart/setup/nextjs (https://github.com/geldata/quickstart-nextjs) appears to be missing.

1st1

Fixed. Thank you for reporting this.

seer

What is the self-hosting story I wonder? If we have our own Postgres db (placed in a specific region for compliance), and we put gel onto our k8s cluster as they state in their docs, does it work well? I assume this type of deployment is free right? What features are we missing from their cloud offering?

GCP has very cool high availability, backup and monitoring features that I’d hate to loose if we move to their cloud offering. Can you configure which region your data is in? Can you put it behind / inside a VPC?

Couldn’t really find that info in the docs / pricing pages.

1st1

> What is the self-hosting story I wonder?

Fully supported, we have a guide for every popular platform [1].

> If we have our own Postgres db (placed in a specific region for compliance), and we put gel onto our k8s cluster as they state in their docs, does it work well?

If you're OK with managing Postgres and your own k8s you won't have a problem.

> I assume this type of deployment is free right?

Yes, and everything you need for that is Apache 2.

> What features are we missing from their cloud offering?

A couple:

1. Slow query log: it requires a custom C extension for Postgres (we wish it did not). It's part of Gel and is open source, but it's not allowed to deploy custom Postgres extensions, say, on AWS Aurora.

2. Integrations with Vercel [2] and GH. With our Cloud you get Vecvel Previews set up out of the box.

3. Convenience: we manage Gel Cloud and it's our headache to keep it running for you. :)

> Can you configure which region your data is in?

We're currently on AWS, but yes, you can configure a region, if you choose to use our cloud.

> Couldn’t really find that info in the docs / pricing pages.

Good point, I'll use this question as a template to add a Q&A there :)

[1] https://docs.geldata.com/resources/guides/deployment [2] https://www.geldata.com/blog/seamless-dx-with-vercel

jackfischer

Tight integration with the typescript tool chain has been great for us with edgeql and is about an order of magnitude less error prone than ORMs I've interacted with. Gel is a winning formula especially in the typescript world.

1st1

Thank you Jack!

the_duke

Lesson: if you start a new database company, start with SQL.

Almost every DB that starts without SQL support eventually ends up adding it back in later.

lmm

That's like saying you should start with microservices/kubernetes/etc. because every company ends up needing those things. IMO you should delay adding SQL as long as possible so that it doesn't compromise your design.

1st1

True. In our case it's not that simple. By resisting adding SQL early on we were able to advance our data model & schema without SQL holding us back. And now we've added SQL in such a way that it takes full advantage of our stack.

aitchnyu

When will Python get a typesafe query builder?

Now there is

``` client.query(''' INSERT User { name := <str>$name, dob := <cal::local_date>$dob } ''', name='Bob', dob=datetime.date(1984, 3, 1)) ```

I'm interested in this and Jetbrains Pycharm and VSCode and CI to catch errors in these.

``` insert(User(name='Bob', dob=datetime.date(1984, 3, 1), children=[User(name='C', dob=datetime.date(2000, 3, 1))]) ```

1st1

Probably Python won't get a typesafe query builder until it catches up with its typing to TypeScript.

Right now in Python the generics are quite rudimentary, there's no equivalent to TypeScript's keyof or mapped types. We're using all of TS' advanced typing system features to make our query builder work.

Python will get a query builder (it's a priority for us now) soon, but it will not be a type safe one. BUT: Python, and all other languages that we support, can use codegen.

Just put your query in a `<name>.edgeql` file, and run a special command. Gel will generate a fully typed function that runs that query.

1st1

Co-founder here - AMA.

keruli

Was the rebrand really just for simplicity and clarity? It seems like a lot of work to change the name when it was already a pretty established toolchain, not just for your team, but, and this is more important, for your community.

I actually think EdgeDB was a far better name. It actually meant something; yes, it wasn't a pure graph database, but it did work with the general concept of graphs and edges. Gel means nothing. Even the domain name: geldata.com makes no sense. You're not selling or creating data, it's a database system/layer.

I've been a true evangelist for EdgeDB over the last two years, but this has really irked me - irrationally so, I'm aware(!), but I just can't see the benefits outweighing the drawbacks here. It feels like it has to have been a result of some legal action or something.

And just as LLMs were starting to catch up with their knowledge cutoff to include EdgeDB too! Now it'll be another two years until they know what you're talking about again. I know, first world problems.

Is the query language name changing, by the way? Or is that still EdgeQL? Please let sanity prevail over at least one thing and don't call it "jel-q-ell"!

1st1

EdgeQL stays EdgeQL :) I like that name.

I also liked EdgeDB (I'm biased, I coined that name myself). But at every conference we had the same conversation with developers:

"EdgeDB? Huh, must be an edge-computing database. Are you running SQLite?"

There are other minor reasons for the rename, but this annoyance persisted for a number of years and we decided to pull the plug on it.

> I've been a true evangelist for EdgeDB over the last two years

Thank you. This means a lot.

re-thc

> But at every conference we had the same conversation with developers

I wonder if this will really go away or just be replaced with something else. Is it really the name "specifically" or how a lot of people work?

(i.e. going by first impressions, connotations, memes, etc)

> "EdgeDB? Huh, must be an edge-computing database. Are you running SQLite?"

"Gel? Huh, must be for cosmetics. Is this for retail?"

p.s. had no issues with EdgeDB.

999900000999

3 questions.

How does this compare to solutions like Supabase. What stands out with Supabase is the sdk support. My current project is probably going to stay on Supabase( it's a hobbyist project regardless), but hypothetically if I was an enterprise prospect how would you pitch your solution.

Do you support functions, that I could call from the client for more advanced logic that can't be done with queries ?

Why not brand as GelDB. Would probably be easier to Google. Plus it tells me instantly what your selling.

PS: Can you offer something like a hobbyist tier for 10$ a month. I don't want to deal with my project randomly shutting off, but I have extremely low requirements in terms of storage during development.

1st1

> How does this compare to solutions like Supabase.

Supabase is great and works well if you want vanilla (more or less) Postgres with some integrations ready to go.

With Gel you get a Postgres with a data layer on top. If you want to have a data model with abstract types & mixins that's easy to work with and scale in complexity, advanced access control, built-in migrations schema engine, hierarchical graph query language on top of SQL, more robust client libraries -- that's Gel.

Gel is opinionated and vertically integrated and that's it's core strength. All of its components were developed in tandem -- from the network protocol to client APIs, from the EdgeQL query language to the data model to the migrations engine and so forth. It provides more cohesive experience and can give you non-trivial performance and DX gains if you commit to it.

> but hypothetically if I was an enterprise prospect how would you pitch your solution.

Total TypeSafety enforced at all levels, built-in migrations engine, best in class access control (we'll be blogging about our access control vs RLS soon.)

> Do you support functions, that I could call from the client for more advanced logic that can't be done with queries ?

With Gel 6 we'll be announcing the new `net` module tomorrow (spoiler!). You'll be able to schedule HTTP calls from triggers/queries/functions.

> Why not brand as GelDB. Would probably be easier to Google. Plus it tells me instantly what your selling.

Well, rebranding from Gel to GelDB would be just a text change to the homepage, so hypothetically the door is open for that. But I hope we can make Gel work, just the same way it works for Render/Neon/Fly.

> PS: Can you offer something like a hobbyist tier for 10$ a month.

Stay tuned, we'll announce some news on that in a couple of days! :)

rajrahul

EdgeDB has declarative schemas with baked in migrations and is a clear differentiator. Supports namespaces within a database. EdgeQL improves nested query performance as they are compiled into a single postgres query

krashidov

If I have an existing postgres db how hard is it to migrate?

Can I write regular joins if I need to?

Do you have plans or do you already support db branching ?

1st1

> If I have an existing postgres db how hard is it to migrate?

The main hurdle would to migrate the schema. You'll have to define your schema in Gel (take a look at the reference here [1]) and write a script to copy your data.

We are discussing internally how we can simplify this process, this is becoming a popular question.

> Can I write regular joins if I need to?

You can use EdgeQL and SQL side by side now though one connection in the same function. Gel's schema is still relational (even though it's more powerful with features like multiple inheritance).

This page describes the details [2] of how SQL works with our schema (spoiler: it's very straightforward and no different from a hardcoded SQL schema).

> Do you have plans or do you already support db branching ?

We call Postgres databases "branches" in Gel. And we have tooling around them [3] to have git-like experience with them. Conceptually you can map (manually) your Gel branches to your Git branches if you wish.

[1] https://docs.geldata.com/reference/datamodel

[2] https://docs.geldata.com/reference/reference/sql_adapter#que...

[3] https://docs.geldata.com/reference/cli/gel_branch

d0100

How to deal with eventual slow queries? I currently have a system with complex queries with a lot of joins where I had to create a custom materialized table

These queries also deal with permissions & realtime scheduling so endpoint caching doesn't solve it

Have gel users hit any performance issues, and how have they dealt with them?

1st1

We're shipping a slow query log UI in this version to continuously monitor queries in your system.

Our users do get performance issues, usually because they start really using our data model to its full potential, creating tens / hundreds complex access policies, 100-lines long EdgeQL queries etc. We have EXPLAIN command to deal with, and we also support our customers directly helping them understand and fix their system. All of the findings trickle down to the core product so that the rest can benefit too.

federalauth

Congrats on the rebrand and launch! Biggest reasons to use Gel over Supabase?

1st1

Good question. We’re indeed similar products.

Gel is somewhat similar to Supabase on the surface—both run on Postgres, both have Auth, and both offer AI features, a CLI, and a UI, among other similarities.

However, there’s a big difference beneath the surface: Gel comes with a high-level data model (abstract types, mixins, access policies) that replaces tables and joins. It’s still relational (and we’re about to publish a paper on that), but it’s more high level, strict, and yet more flexible.

On top of that, we have a built-in migration system (where schema is a first-class citizen), a performance-tuned network protocol, and a query language called EdgeQL, which is like a child of SQL and GraphQL. These are just a few of our “deep” features.

All in all, Gel is a fresh take on day-to-day database development. We cut no corners in trying to push the core database developer experience forward.

kelthuzad

Just a user here, but I'd say there are many reasons, one of those reasons is in your name: auth.

GelDB's auth is versatile and doesn't cost a dime, while Supabase auth is only free up until 50,000 monthly active users, then it costs $0.00325 per MAU (> 100k MAU).

I personally just love its query language and the typescript query builder.

armincerf

It says gel is to Postgres what typescript is to JavaScript, so can I add gel to an existing Postgres instance and get the benefits of the nicer query language or does it rely on special tables? If I use some other extension like timescale is that compatible with gel?

And is there a story for replication/subscribing to queries for real time updates?

Postgres is so powerful partly because of its ecosystem, so I want to know how much of that ecosystem is still useable if I’m using gel on top of Postgres

RedCrowbar

(article author here)

> If I use some other extension like timescale is that compatible with gel [...] Postgres is so powerful partly because of its ecosystem, so I want to know how much of that ecosystem is still useable if I’m using gel on top of Postgres

Playing nice with the ecosystem is the goal. We started off with more of a walled garden, but with 6.0 a lot of those walls came down with direct SQL support and support for standalone extensions [1]. There is a blog post coming about this specifically tomorrow (I think).

> And is there a story for replication

Replication/failover works out of the box.

> subscribing to queries for real time updates?

Working on it.

> so can I add gel to an existing Postgres instance and get the benefits of the nicer query language or does it rely on special tables?

Gel is built around its schema, so you will need to import your SQL schema. After that you can query things with EdgeQL (or SQL/ORM as before).

[1] https://github.com/geldata/gel-postgis

1st1

In the just released new version we've added SQL support, so now you can use SQL taking full advantage of our data model (access policies, mixins, etc) and the network protocol (automatic recovery on network & transaction error, automatic connection pooling on client/sever).

We'll continue bridging the gap to make it easier for companies to adopt Gel for an existing database. We either will invest in creating a tool for migration, or maybe some more exciting options we're currently pondering on.

atombender

Looks like you changed your site and broke current links. For example, searching for EdgeQL gives me this as the first hit: https://docs.edgedb.com/database/edgeql. That redirects to https://docs.geldata.com/database/edgeql, which is 404.

1st1

Yeah, we'll be repairing this shortly. FWIW we're completely revamping our documentation, it's almost a full rewrite, focused on bringing clarity and logic to the navigation, improving search, etc. We should fully wrap it up in a week or two.