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.
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 projectRelated notes
All insightsWhen spreadsheets stop being enough
The signs that a spreadsheet-driven operation needs a real system, and the cheapest first step that is not a full ERP implementation.
ReadCustom softwareHow to justify an internal tool
A simple model for calculating whether an internal tool pays for itself, using hours recovered, error cost and the value of visibility.
ReadCustom softwareIntegrating systems without creating a spider web
How to connect CRM, ERP, payments and internal tools with clear ownership of data, retries and error handling.
Read