Menu
Apexsoft Digital Agency

The database is the last thing you can change cheaply

Screens get redesigned every year. The shape of the data outlives all of it, and every shortcut taken there is paid for later, with interest.

2 min read Engineering Apexsoft

A button can be moved in an afternoon. A page can be rebuilt in a week. A column that turned out to mean two different things takes a migration, a backfill, an audit of everything that reads it, and a conversation with whoever has been relying on the old meaning.

This asymmetry is the single most useful thing to keep in mind when a system is being designed.

The shortcuts that cost the most

A status column that also implies a date. Shipped means shipped, but when? If the answer is “look at updated_at”, you have stored one fact in a field that changes for unrelated reasons, and the first time somebody edits the note on that order, the shipping date moves.

A total stored as a computation of current prices. Re-price the catalogue and every historic order silently changes. Documents that have left the building — invoices, agreements, receipts — need their numbers frozen as columns, because they are a record of what was agreed, not a view of what things cost today.

A boolean that will obviously become three states. is_approved becomes approved, rejected, waiting on the client about a month after launch, and by then it is in six queries and two reports.

And the classic: one column holding a value whose meaning depends on another column. It always starts as a small convenience and always ends as a rule that lives only in somebody’s head.

Name things after the business, not the screen

A table called submissions because the first feature was a form will be confusing forever. A table called quote_requests still makes sense when the form is redesigned, when they start arriving by email, and when somebody creates one by hand on the phone.

The screen is the current way the data is captured. It is not what the data is.

When to allow the shortcut

There is a legitimate version of all this: when you genuinely do not yet know the shape, store the raw thing and derive the rest. That is a decision, and it should be written down where the next person will find it.

What is not a decision is discovering in year two that a column has meant three different things depending on when the row was written. Nobody chose that. It just accumulated, one afternoon at a time.

Tell us what is not working.

A quote takes about five minutes to request and we reply within two working days — with a real assessment, not a brochure.

WhatsApp: +62 851-6897-6447