technologies / database engineering

The Schema Outlives The Application

Frameworks get replaced; the data does not. We design schemas, constraints, indexes, migrations and query paths as first-class engineering — because the performance problems we are called about eventually turn out to live here.

The relational core under our shipped platforms
PostgreSQL · MySQL
Migrations versioned and run by the pipeline
Reversible
Query plans read before an index is added
Plans first

the thesis

Most Slow Software Is A Data Problem

When a platform gets slow the framework is blamed and the database is usually guilty — not because it is weak, but because nobody planned the shape of the questions it would be asked.

A schema is a set of promises about what can be true. Get it right and impossible states are impossible: a constraint refuses the bad row, a foreign key refuses the orphan, a unique index turns a double submission into a caught error instead of a duplicate customer. Get it wrong and every one of those becomes application code somebody forgets to write, discovered months later as a support ticket about numbers that do not add up.

Performance follows the same rule. Indexes are designed against the queries a product actually runs, chosen by reading plans rather than by adding one per column. The queries that hurt are usually structural — a list view issuing a query per row, an unbounded join, a report scanning a whole table because a filter was written on the wrong side of a function. Caching hides all three for a while, then makes them harder to find.

The rest is the part nobody demos: migrations that are reversible and run in the pipeline rather than by hand at midnight, backups that have actually been restored, replicas read from deliberately, and archival started before the table is large enough to make every later decision harder. None of this is sold here as its own engagement. It is the layer under the platforms we build, and it is why those platforms are still quick.

Schema designConstraints & integrityIndex strategyQuery plansReversible migrationsReplicas & backupsArchival

argued both ways

Where Database Engineering earns its place — and where it loses.

we reach for it when

Every platform we build and every one we are called in to rescue — schema, constraints, indexes, migrations and query paths designed against the questions the product will actually ask.

we argue against it when

It is not a standalone engagement to buy. If the answer is one missing index, we say so and charge for the afternoon rather than proposing a data programme.

the proof

Where Database Engineering has already shipped.

Not sold as a separate engagement here, and not claimed as one. The rows below are published case studies whose relational core we designed and still operate — a valuation platform's adjustment history, a property index reconciled from feeds that disagree, a training product's plan library, a nutrition product's food catalogue and daily journal, a multi-carrier shipping platform's rate and customs tables. In each, the schema is the part holding the story up.

What we build into the data layer.

Schemas For Products That Grow

The model designed against the questions the product will ask, with the constraints that make wrong states unrepresentable rather than merely unlikely — and normalised until the read patterns argue otherwise.

Index And Query Strategy

Indexes chosen by reading plans, expensive queries rewritten rather than cached over, and the per-row query patterns that frameworks make easy removed before one of them becomes the outage.

Change Without Downtime

Schema change as ordinary, reversible, pipeline-run work — including the expand-and-contract sequences that let a column split or a type change happen while the product keeps serving.

Multi-Tenant Data Models

Tenant isolation decided deliberately — shared schema with enforced scoping, or a schema apiece — with the consequences for backups, migrations and noisy neighbours stated before the choice is locked in.

Reporting That Leaves Production Alone

Analytical queries moved off the path serving customers: read replicas, aggregates refreshed on a schedule instead of recomputed per request, and an honest line on when a separate analytical store is the real answer.

Rescues: Locks, Growth And Mystery Latency

Existing databases with lock contention, runaway table growth, or a p95 nobody can explain — instrumented, diagnosed against real traffic, and fixed structurally rather than by buying a larger instance.

the database engineering ecosystem we ship with

Relational

PostgreSQL · MySQL · SQLite

Caching & Queues

Redis · BullMQ

Access Layers

Eloquent · Doctrine · Prisma

Operations

Migrations · Read replicas · Restore drills · Plan analysis

asked before choosing

Database Engineering questions, answered straight.

PostgreSQL or MySQL?

Both are excellent, and in context the decision is rarely close. PostgreSQL when the data model is the interesting part — richer types, expressive constraints, window functions, JSON that behaves like a first-class column, geospatial work. MySQL when the platform, the hosting and the team are already built around it and the workload is straightforward transactional traffic. Familiarity is a legitimate tiebreaker: the database your team can operate at three in the morning beats the one that scores better on paper.

When does a relational database stop being enough?

Later than most stack conversations assume. Modern relational engines handle document payloads, geospatial queries and respectable full-text search, so a second store should be added when a specific workload is measurably failing — not because a category exists. When search genuinely outgrows it we say so, and that argument has a page of its own here. The same discipline applies to caches, queues and warehouses.

Do we need a non-relational store?

Sometimes, for a specific job: a document store for genuinely schemaless payloads, a key-value store for ephemeral state, a time-series store for high-volume metrics. What we argue against is choosing one as the primary store because relational feels old-fashioned. The moment your data has relationships that must stay consistent, you will rebuild joins and transactions in application code — and the application will be worse at both than the database was.

How do you change a schema on a live product?

In steps that are safe at every point. Add the new shape alongside the old, write to both, backfill in batches that do not hold locks, move reads across, then remove what is no longer read. Every step is a reversible migration that runs with the deployment. The slow version of this is the one that does not need a maintenance window.

Our reports are killing the application. What now?

First we separate the traffic — analytical queries do not belong on the connection serving customers. That usually means a read replica and, for the heaviest views, aggregates computed on a schedule rather than per request. If the reporting appetite keeps growing past that, the honest recommendation is a separate analytical store, and we will tell you when you have crossed that line instead of tuning forever.

Who owns the data and the backups?

You do. The database runs in your infrastructure, the schema and migrations are code in your repository, and the backup policy is written down with a restore that has actually been performed. A backup nobody has restored is a belief, not a policy.

Queries getting slower every month?

Send the slow endpoints and the schema. You'll get the plans back, what is structural, what is one index, and an honest line on which of those is worth doing first.