Announcing DoltgreSQL

RELEASEDOLTGRES
3 min read

We are pleased to announce that we have started development on DoltgreSQL! Dolt has grown significantly over the past few years, however it uses MySQL's syntax. Many users have asked us if we would support PostgreSQL's syntax, and we are finally developing a product exactly for that!

What is Dolt?

Dolt is the core technology of DoltHub. It's a version-controlled database, which we like to frame as though MySQL and Git had a baby. All of the power that branching, merging, diffs, etc. give to source code, now also applies to databases with Dolt. Dolt is a drop-in replacement for MySQL as it implements its syntax and wire protocol, however it does not contain any MySQL code, as the complexities and challenges inherent to solving the version-control case for databases required bespoke solutions. Dolt is also production ready, and is already bringing immense value to several companies tackling complex problems. If you do not have the specific requirement of using a PostgreSQL-flavored database, then we highly recommend Dolt.

DoltgreSQL vs Dolt

As mentioned earlier, Dolt is our MySQL-flavor of a version-controlled database. It also leans into the command-line paradigm, making it very familiar to users of Git (all version control commands are available as SQL procedures as well). With DoltgreSQL, we're taking a slightly different approach, and building a product that is specifically focused on the database server experience. It does not have any command-line functionality, and is instead being built as an easy-to-deploy server, with a deeper level of customization for those that desire it. We feel that this is aligned more with the general PostgreSQL audience, and also differentiates the products outside the PostgreSQL/MySQL differences.

Why not do X?

DoltgreSQL works by emulating a PostgreSQL server, and converting received commands into an AST that is given to an underlying Dolt server. This enabled us to get something up and running quickly, while leveraging the capabilities and functionality that Dolt already provides. The Dolt layer is very stable and battle-tested, so we only need to focus on the emulation layer, which significantly reduces scope and makes development much easier.

Before we took this approach, we looked at quite a few other approaches, from writing a foreign data wrapper, to building a new storage backend for PostgreSQL, to even forking PostgreSQL itself. Many approaches were too limited to fully support our versioning features, while others (such as forking PostgreSQL) would require potentially years of development time just to get to a similar position that we are at today. Another wrinkle is that we've had many users state that they want PostgreSQL, but they didn't state whether they wanted the syntax, or if they have a requirement to run the actual PostgreSQL binary. If you have a requirement of running the PostgreSQL binary in some form, then definitely let us know!

Getting Started

Even at this early stage, DoltgreSQL is very easy to use.

  1. Download the latest release
  2. Put the binary on your PATH.
  3. Navigate to a directory you want your database data stored (eg. ~/doltgresql).
  4. Run doltgres. This will create a doltgres user and a doltgres database.
  5. Open a new terminal. Connect with the following command: psql -h localhost -U doltgres. This will connect to the doltgres database with the doltgres user.
  6. Run CREATE TABLE example (pk INT8 PRIMARY KEY);

This will create a database, connect to it, and create a table. It's even more simple than Dolt, which was already praised for its simplicity.

It is important to set expectations, even with it being super easy to get started. DoltgreSQL is in its very early stages, and therefore expect a lot of errors, issues, and unexpected behavior. We are rapidly making progress, and it's expected that releases will quickly become outdated, so building from source is the best way to check out the latest progress. We will, however, make frequent releases for those that want to test it without going through the compilation process.

For the future

We definitely welcome all issues and contributions! We'd love to hear your ideas, thoughts, and opinions, so you can find us on Twitter/X and chat with us on Discord. We are very excited for the future of DoltgreSQL, and we hope you'll join us for the ride!

SHARE

JOIN THE DATA EVOLUTION

Get started with Dolt

Or join our mailing list to get product updates.