>_ DevTrendsen

Language

Home

Languages

Sections

Frontend Backend Mobile DevOps AI / ML GameDev Blockchain Embedded Security
JavaScript

DbGate: A Universal Database Client for Web and Desktop

Usually, a modern backend stack isn't limited to a single DBMS. A project can easily have PostgreSQL for the main relational model, Redis for caching and sessions, ClickHouse for analytical logs, and MongoDB for unstructured documents. In this situation, opening four different heavy clients or keeping multiple DBeaver tabs open is a dubious pleasure.

I recently stumbled upon DbGate. It's a GPL-3.0 licensed project that aims to solve the database zoo problem with a unified approach. The most interesting part is that the client works equally well as a desktop application on Electron and as a lightweight web interface in a Docker container.

What the project can do

DbGate supports both SQL and NoSQL data sources. The compatibility list includes Postgres, MySQL, SQLite, SQL Server, Oracle, MariaDB, ClickHouse, DuckDB, CockroachDB, Firebird, Cassandra, MongoDB, and Redis.

The tool handles routine data administration and offers several non-standard features:

  • Navigation through Foreign Key relationships. In table view, you can expand child records from a related table directly from a row (Master/Detail) or pull columns via foreign key without writing JOINs manually.
  • View and edit data with change script generation. You click on cells, edit values, and before sending to the database, you can review the generated SQL patch.
  • Visual query builder. Helps you sketch out a query structure with the mouse if you're too lazy to write long expressions by hand, including selections with WHERE NOT EXISTS.
  • Built-in viewer for NDJSON, JSON, CSV, and Excel files. Large NDJSON files can even be opened and edited directly on disk without prior import.
  • ER diagrams and schema comparison with migration synchronization generation.
  • Data visualization on maps for GEO columns and building simple charts with HTML export.

How the architecture works

Under the hood, the project uses a very practical stack:

  • The frontend is written in Svelte. The interface responds quickly, isn't cluttered with unnecessary DOM nodes, and renders large virtualized tables swiftly.
  • The backend runs on Node.js and Express, using standard database connectors.
  • The desktop build wraps everything in Electron for Windows, Linux, and macOS.

The modularity is interesting. Many utilities are split into separate NPM packages. For example, if you need a pipeline for scheduled CSV data export, Node.js scripts can run autonomously on a server without a graphical interface.

Additionally, a plugin system is implemented. By writing a small module in TypeScript or JavaScript, you can plug in a custom driver or add a parser for a rare file format.

Quick start

If you want to try the client without installing it on your machine, the easiest way is to spin up the web version in Docker:

docker run -it --name dbgate-instance --restart always -p 3000:3000 dbgate/dbgate

After that, open http://localhost:3000 in your browser and connect to local or remote databases.

For those who want to build the project locally and dig into the source code:

git clone https://github.com/dbgate/dbgate.git
cd dbgate
yarn
yarn start

The command will start the backend on port 3000 and the web interface on port 5001.

Use cases

In practice, DbGate excellently covers two tasks:

  1. Personal developer tool. Replaces the combination of DBeaver, RedisInsight, and MongoDB Compass without devouring gigabytes of RAM on startup.
  2. Internal team dashboard on a server. By spinning up the Docker image inside a closed network, you give analysts and developers access to databases through a unified web interface without each person needing to configure SSH tunnels and local utilities.

Who it's for

If you're tired of slow startup times for heavy Java clients or switching between separate programs for Redis and PostgreSQL, DbGate is definitely worth a look. The project is actively developed, distributed under a free license, and available in both desktop and server variants.

Related projects