Engineering

Why Git Makes a Better ERP Database Than PostgreSQL

August 20, 2026 · 8 min read · NeoDonkey Engineering

Every ERP vendor uses PostgreSQL. SAP, Oracle, Odoo, ERPNext, they all store your company's data in relational tables, wrapped in ACID transactions, backed up nightly, and replicated across availability zones.

We chose git. And not as a backup mechanism, git is our database.

The Problem with Database-First ERP

Traditional ERP architecture assumes a central database is the source of truth. This creates three fundamental problems that every ERP user eventually faces:

  1. The audit problem, You need an "audit table" that records every change, but it's separate from the actual data. If someone with admin access modifies both, you have no way to know.
  2. The migration problem, Your company's history lives in a proprietary schema. Want to leave? Pay €40K for "data extraction" and pray the CSV exports are complete.
  3. The collaboration problem, Two people can't edit the same record simultaneously. Database locks force serialization, creating bottlenecks in fast-moving operations.

Git Solves All Three

1. Immutable Audit Trail

In git, every change is a commit. Every commit has an author, a timestamp, and a cryptographic hash. You cannot alter history without breaking every subsequent hash, it's mathematically infeasible.

$ git log --oneline
a3f7d2e feat: invoice INV-2026-0819-001 (+€12,500.00)
8e9c1b4 fix: correct VAT rate for DE transactions
7d4f8a2 feat: add new supplier "Global Logistics GmbH"
...

No separate audit table. No "last_modified_by" column that can be backdated. The commit history is the audit trail, and it's cryptographically protected.

2. Portable, Open Data Format

A git repository is just a folder with a specific structure. Clone it, and you have everything, data, history, and the code that reads it. No proprietary formats, no extraction fees, no vendor dependency.

$ git clone https://github.com/your-company/ledger.git
$ cd ledger
$ ls
2026/
  08/
    19/
      invoices/
      journal/
      suppliers/
operating-model.md
signing-keys/
...

3. Conflict Resolution, Not Locking

When two people edit the same record in a database, one waits or gets an error. In git, both create commits, and the system merges them, just like developers collaborate on code.

# Alice creates an invoice
$ git commit -m "feat: invoice INV-2026-001"

# Bob adds a supplier
$ git commit -m "feat: supplier Global Logistics"

# Sync merges both changes
$ git pull --rebase
# No conflicts, changes are in different files
$ git push

But What About Queries?

This is the first question every database engineer asks. "How do you run SELECT SUM(amount) FROM invoices WHERE status='open'?"

Answer: You index. Just like PostgreSQL builds B-trees on disk, NeoDonkey builds indexes in memory from the git objects. The difference: our indexes are derived data, not the source of truth. If an index corrupts, rebuild it from the commits. If a PostgreSQL index corrupts, you might not notice until it's too late.

// Build an index from the git history
const index = {
  'suppliers': new Map(),
  'open-invoices': new Set(),
  'account-balances': new Map()
};

// Replay every commit to build current state
for (const commit of commits) {
  apply(commit, index);
}

// O(1) lookups
const balance = index['account-balances'].get('1200');

The Trade-Offs

We're not claiming git is always better than PostgreSQL. If you need sub-millisecond latency on 10,000 concurrent transactions, use a database. If you need complex ad-hoc queries across terabytes of data, use a database.

But for most SMEs, companies with 5-500 employees, hundreds of transactions per day, not millions, git is not just sufficient. It's superior for the things that matter: auditability, portability, and collaboration.

"The best time to choose git over PostgreSQL was when you started your ERP. The second best time is now."

Try It

NeoDonkey creates a git repository in your browser. Every invoice, every journal entry, every supplier change is a signed commit. Open your browser's developer tools and run git log, it's a real repository.

Try NeoDonkey Free →


Published by NeoDonkey Engineering. View source on GitHub.