Skip to content
Custom software

Database design mistakes that cost years

Most long-term maintenance pain is not caused by code. It is caused by a data model that could not express the business, so every new feature becomes an exception.

7 September 20266 min readCodetoli Services

The recurring mistakes

No stable identifier on entities that people talk about, such as customers or invoices. Status stored as free text, so reports need string matching. Derived values stored without a rule for recalculation, so totals disagree with line items.

Storing dates without time zones, and money as floating point, round out the list.

Model the rules, not the screens

A screen is a view of the data, and screens change faster than rules. If the model encodes workflow states and relationships, new screens become cheap. If it encodes a particular form, every change becomes a migration.

Migration discipline

Every schema change should be a versioned migration that runs the same way in development, staging and production. Ad hoc changes made directly in production are the reason environments drift.

Common questions

Is NoSQL better for business applications?
Rarely for transactional operations with relationships and reporting. Document stores fit content and event data better than ledgers and inventories.
Should we store calculated totals?
Only with a defined recalculation path and a way to detect drift. Otherwise compute on read until performance proves it necessary.

Next step

If this question is live in your business right now, describe the situation and you will get a written view on the options, including whether you should build at all.

Discuss your project

Next step

Tell us what you are trying to fix.

A short conversation is usually enough to know whether we are the right fit. If we are not, we will say so.

contact@codetoli.in+91 80975 43178

Replies within one business day

Chat on WhatsApp