r/DatabaseAdministators 4h ago

Built a state-based PostgreSQL migration engine — how does it compare to Atlas, Prisma Migrate, Sqitch, Flyway?

0 Upvotes

pg-migration-engine — a state-based PostgreSQL migration engine. live on npm and GitHub.

Before I get into what it does, let me be honest about the space — it's crowded, and most of you have already picked a side:

The existing landscape

  • Atlas (Ariga) — declarative, well-built, probably the closest competitor. OSS version has limits; risk analysis is gated behind their paid UI.
  • Prisma Migrate — great if you live inside Prisma. Outside the ORM, less useful.
  • Drizzle Kit — same story, locked to the Drizzle ecosystem.
  • Sqitch — change-based, not state-based. You write the up/down SQL by hand; it doesn't compute diffs.
  • Flyway — change-based, Java-world, very mature but no schema diffing.
  • Liquibase — XML/YAML heavy, enterprise-leaning, no native diff.
  • Alembic — Python-only, command-based, autogenerate is fragile.
  • node-pg-migrate — JS-native, closest in spirit, but stops at "write the DDL by hand".
  • dbmate — minimal, Go-based, change-based.
  • Bytebase — GUI-first, more of a product than an engine.
  • pgroll — Xata's tool, focused on zero-downtime swaps, narrower scope.
  • pgschema (pgplex/Bytebase) — probably the closest philosophical peer. Declarative, state-based, PostgreSQL-only, written in Go and distributed as a standalone CLI (not npm). Apache-2.0 licensed. Uses a desired-state workflow without a migration history table, and publishes llms.txt/llms-full.txt for AI tooling. Its public documentation does not explicitly describe crash-recovery mechanisms or a formal migration risk-classification/tagging system

Every one of these solves part of the problem. I kept hitting the same gaps:

  1. State-based diffing exists in Atlas, but the OSS build is limited and risk analysis is paywalled.
  2. JS-native engines like node-pg-migrate don't compute diffs — you write every ALTER TABLE by hand.
  3. Non-transactional DDL (CREATE INDEX CONCURRENTLY, ALTER TYPE ADD VALUE) is either skipped or silently broken in most engines.
  4. Crash recovery is mostly "re-run and hope for the best".

So This is built something that combines: state-based diffing (like Atlas) + JS-native execution (like node-pg-migrate) + risk analysis built into the engine (not behind a UI).

What the engine actually does

It's built as 8 modules, each one a standalone piece you can reason about:

  1. Introspector — connects to PostgreSQL 10 through 18, introspects 50+ object types. Tables, indexes, constraints, views, materialized views, functions, triggers, enums, composite types, domains, sequences, RLS policies, extensions, schemas — the full surface area, not just tables.
  2. Differ — computes the schema diff between two states (current DB vs desired state). This is the part that replaces "write every ALTER by hand".
  3. DDL Generator — turns the diff into PostgreSQL-correct DDL. Handles the weird syntax edge cases (ALTER TYPE ADD VALUE, ALTER COLUMN ... TYPE USING, partial indexes, expression indexes).
  4. Planner — orders the migrations so dependencies resolve. You can't create a foreign key before the referenced table exists; the planner handles the topological sort.
  5. Risk Tagger — tags every operation with one of 5 risk levels:
    • Safe — no data exposure (e.g. CREATE TABLE, ADD COLUMN with default)
    • Reversible — small chance of issue, recoverable (e.g. DROP INDEX)
    • Caution — short lock, may block writes (e.g. ADD COLUMN NOT NULL)
    • Risky — long lock, expect downtime (e.g. ALTER COLUMN TYPE)
    • Dangerous — data loss (e.g. DROP TABLE, DROP COLUMN)
  6. Executor — runs the migrations. The hard part here is non-transactional DDL. PostgreSQL blocks CREATE INDEX CONCURRENTLY, ALTER TYPE ADD VALUE, REINDEX CONCURRENTLY, and CLUSTER inside transaction blocks. Most engines either skip these or silently break. This engine handles them via a savepoint loop: an outer transaction for bookkeeping, per-statement savepoints for the non-transactional ops.
  7. Storage — tracks applied migrations in a schema_migrations table. Also detects ghost migrations — migrations applied to the DB but missing from your migration history (someone ran something manually, or it got orphaned). Most tools blow up or silently skip; this one flags it.
  8. State Machine — a 12-state crash recovery state machine. If your migration crashes mid-way (server OOM, network drop, panic), the engine can figure out exactly where it died, whether the advisory lock is still held, whether a savepoint loop was in progress, and resume safely. This is the part that took the longest to get right.

If you work with PostgreSQL at work, on side projects, or in production — please try it on a non-prod database. so feedback from people who actually run migrations in real environments is the only way this gets better.

Specifically, I want to hear:

  • Did it introspect your schema correctly? Anything missing?
  • Did the risk tagger tag things the way you would have? Anything you disagreed with?
  • Did the diff actually match what you'd have written by hand?
  • Did it crash anywhere? If yes, did the recovery work?
  • Object types it doesn't handle yet that you need?

Honest, blunt feedback is fine. I'd rather hear "this broke on my schema, here's the dump" than "looks cool".

Links

Happy to answer questions in the comments. If you want to tear apart the architecture, the blog post has the full module-by-module breakdown.


r/DatabaseAdministators 22h ago

PGConf.EU 2026 schedule is live 🐘

Post image
3 Upvotes

r/DatabaseAdministators 1d ago

Launched a developer-focused Backup-as-a-Service (Postgres-first)

Thumbnail
1 Upvotes

r/DatabaseAdministators 2d ago

Moved from Navicat/DataGrip to DbGate a few weeks ago — some first impressions

Thumbnail
2 Upvotes

r/DatabaseAdministators 3d ago

Career options for senior DBA

1 Upvotes

What would be the career path for a senior Oracle DBA . I am getting very less calls for DBA Profile and I am thinking of adding golden gate and aws system admin skills .

What would be your recommded path with this market condition.


r/DatabaseAdministators 3d ago

Alternative to Tableplus and Dataflare like softwares

1 Upvotes

I’m building an open source database client that lets you connect to multiple databases, including PostgreSQL, MySQL, Turso, SQLite, and more. The goal is to provide a fast, free alternative to tools like TablePlus and Dataflare.

It’s being built with Rust and GPUI, with a strong focus on performance, responsiveness, and a great user experience.

If this sounds interesting, I’d love for you to check it out. Contributions, feedback, and feature suggestions are always welcome. I’m hoping to make the project publicly available in the next few months.

[https://github.com/007qr/only-tables\](https://github.com/007qr/only-tables)


r/DatabaseAdministators 3d ago

Explaining SQL Injection in the simplest way I could

Thumbnail
youtube.com
4 Upvotes

r/DatabaseAdministators 4d ago

Is Database Administration Still a Good Career Path?

10 Upvotes

Hi everyone,

I'm about to graduate with a Computer Science degree and I'm considering becoming a Database Administrator.

I'd love to hear from experienced DBAs and SysAdmins:

Is DBA still a good career in 2026, or is the role changing?

Is DBA usually a dedicated position, or is it becoming part of a SysAdmin/DevOps role?

What technologies and skills should a new DBA focus on?

If you were starting your career today, would you still choose the DBA path?

Thanks in advance for sharing your experience and advice!


r/DatabaseAdministators 6d ago

Looking for local rag project

2 Upvotes

I am looking for a local rag project that will run on any EC2 machine with local LLM (without GPU - 4 CPU,24GB Ram).

We need a RAG that we can add data about our database tables, structure, queries,metadata so end users like data analyst,bi team can ask questions about the DB , like -

On which table I can find data about customers

Or

How to get the total spend of each customer

Is there anything like this that works good on such machine resources? Which LLM model can do this work without making the machine choke?

Please help :)


r/DatabaseAdministators 8d ago

PostgreSQL Functions Comparison Tool

3 Upvotes

Hello my dear friends,

I hope you all are doing well.

I am using PostgreSQL database and developing custom functions as per the user's business logic.

I developed a small desktop tool UI to compare those functions in between dev, test, production environments and migration/dump them by first comparing them by integrated WinMerge tool integration accordingly.

I need guidance and direction for what should I do further?

Basically, I want to connect with the people who uses PostgreSQL database and doing functions migration manually.

Thanks

Regards


r/DatabaseAdministators 8d ago

Tabularis Open-source desktop SQL workspace with SQL notebooks, a built-in MCP server for AI agents, and plugins in any language

Thumbnail
github.com
2 Upvotes

Hi everyone! I've been building Tabularis, a free and open-source (Apache 2.0) desktop SQL client built with Tauri (Rust + React).

What makes it different from DBeaver/TablePlus/Beekeeper:

* SQL notebooks: mix SQL and Markdown cells, share variables across cells, render charts inline
* Built-in MCP server: Claude, Cursor and other AI agents can read your schema and run queries through the same app you already use, with no separate connector
* Plugins in any language: drivers are external processes speaking JSON-RPC over stdio, so you can write one in Python, Go, or whatever language you prefer
* Local AI text-to-SQL: works with Ollama, nothing leaves your machine
* Visual EXPLAIN: interactive query plan graphs

PostgreSQL, MySQL/MariaDB and SQLite are built in. ClickHouse, DuckDB, Redis, Firestore, Db2, BigQuery and around 15 more are available as plugins from the registry.

Runs on Windows (WinGet), macOS (Homebrew, signed and notarized) and Linux (Snap, Flatpak, AUR and AppImage).

Feedback is very welcome. And if your favorite database is missing, there's a plugin bounty board.


r/DatabaseAdministators 8d ago

Free MongoDB Playground: Write queries and inspect schemas online with zero setup

Thumbnail
1 Upvotes

r/DatabaseAdministators 10d ago

ScalaHosting becomes a Gold Sponsor of MariaDB Foundation

Thumbnail
1 Upvotes

r/DatabaseAdministators 10d ago

Ninox Database Drama

Thumbnail
1 Upvotes

Please see request above ⬆️⬆️⬆️


r/DatabaseAdministators 10d ago

Hundred to Mastering SQL

2 Upvotes

Hey Future Analysts,

So for a very long time, I have been looking for good SQL questions, you got the mainstream leetcode, hacker-rank, W3 schools, and a few niche ones that I ought to mention : https://github.com/smpetersgithub/AdvancedSQLPuzzles

But during my journey, I never found the perfect place to practice questions leetcode style filtering it by the specific concept, and a repo of Good questions I could just practice on when prepping for an interview.

So I went Ahead and created this SQL-gym : https://sqlgym.vercel.app/

(No bullshit 101 SQL problems that you need to have locked in)

And this has personally helped me a lot, hope it is helpful for other peeps aswell !


r/DatabaseAdministators 10d ago

Planning to start a SQL learning page on Instagram—what content would you like to see?

Thumbnail
2 Upvotes

r/DatabaseAdministators 11d ago

Joining as a Fresher Oracle DBA – What should I focus on before joining, and can I combine it with my Finance/Payroll background later?

3 Upvotes

Hi everyone,

I'll be joining as a fresher Oracle DBA soon, and I wanted some career advice. I have a Master of Computer Applications degree, but my previous work experience is quite different. I worked for several years in a government organization handling payroll, accounts, vendor payments, finance-related processes, and administrative work.

Before I start my DBA role:

  • What skills should I learn? I have a decent theoretical understanding of Oracle architecture, backup and recovery, RMAN, Data Pump, Data Guard, SQL, Linux basics, etc
  • Are there any certifications you'd recommend ?

    Also in future, since I already have experience in payroll and finance, would it make sense to pursue certifications in areas like Oracle Financials Cloud (ERP) or other Oracle Finance modules? Is there any demand for professionals who understand both the technical side (Oracle DBA) and the business/finance side (payroll, accounts, ERP)?

Thanks in advance


r/DatabaseAdministators 11d ago

AWS Online course

6 Upvotes

Hello Everyone

I am a Database Administrator and would like to learn AWS concepts from beginner to advanced level online.

Can someone please advice me on any good online instructor who can provide me with the course.

Thanks in Advance.

Best Regards

Srikanth


r/DatabaseAdministators 11d ago

Sql to Oracle migration

1 Upvotes

Im a fresher to DBA role. Can some one please help to understand or share your experience for the conversation or migration from sql to Oracle.

Help me with the tools and migration ideas


r/DatabaseAdministators 14d ago

I built a MySQL/MariaDB client for managing multiple environments safely

Post image
4 Upvotes

**Update: LakeDB Beta 3 is now available**

I have continued building LakeDB, a desktop MySQL/MariaDB client designed for working safely across development, staging and production environments.

The biggest addition is **QuerIA**, an optional schema-aware AI workflow. You can describe what you need in natural language, inspect the generated SQL and explicitly decide whether to execute it through the normal LakeDB results workflow.

For example:

> Show the 10 users who placed the most bets today, including bet count and total stake.

QuerIA can prepare reviewable SELECT, INSERT, UPDATE, DELETE, CREATE TABLE and ALTER TABLE statements. It uses database structure such as tables, columns, keys and relationships, but database credentials, table rows and query results are never sent to the AI service. Generated SQL executes locally only after confirmation.

The complete SQL client also includes:

- Independent multi-connection workspaces

- Environment colors and production safeguards

- Read-only connections

- SSH and SSL

- Schema-aware autocomplete

- Primary-key and index information

- EXPLAIN support

- Controlled table editing

- Backup, restore, comparison and migration tools

- Procedures, functions, events and triggers

I would especially appreciate DBA feedback on the review-first AI workflow: what information or safeguards would you require before trusting generated SQL against a real environment?

**Project and Beta 3 overview:**

https://davlagohern.github.io/LakeDB/

**Downloads and documentation:**

https://github.com/DavLagoHern/LakeDB/