Busy period · Next start for new projects: December 10 · Next: December 10

Call now: +90 (532) 641 67 08
TREN Get a Quote

What Is Database Design? How to Build a Fast, Scalable Data Model

What Is Database Design? How to Build a Fast, Scalable Data Model

Database design is the work of organising the data a piece of software stores into the right tables, relationships between tables, data types and indexes. A well-designed database stays fast and consistent for years; a badly designed one slows down as the number of users grows and produces inconsistent reports.

I start every piece of software I write from the database, not from the screen. An interface can be changed, but fixing a wrongly built data model in a live system is far more costly.

What makes a good database design

  • No duplicated data (normalisation): A customer's address lives in one place; when it changes, it is updated everywhere.
  • Correct data types: Amounts are stored as decimals and dates as date types, so calculation errors are prevented from the start.
  • Integrity rules: The invoices of a deleted customer are not left orphaned; foreign keys and constraints protect the data.
  • The right indexes: Indexing the most searched fields brings searches across millions of records down to milliseconds.
  • Scalability: In multi-tenant systems, each company's data is separated securely.

What is normalisation?

Normalisation is the method of splitting tables into logical parts to avoid repeating data. For example, instead of writing the company name on every row of a weighing record, companies are kept in a separate table and the weighing table stores only the company number. When the company name changes, there is no need to update thousands of rows.

How do you speed up slow queries?

  1. Measure the query: Find the bottleneck with the slow query log and EXPLAIN output.
  2. Add missing indexes: Fields used in WHERE, JOIN and ORDER BY are indexed.
  3. Don't fetch unnecessary data: Select only the fields you need instead of SELECT *, and use pagination.
  4. Put calculations in the right place: Use views, stored procedures or summary tables for frequently used totals.
  5. Plan for data growth: Old records are moved to archive tables.

MySQL or MS SQL Server?

CriterionMySQL / MariaDBMS SQL Server
LicenceOpen sourcePaid (Express edition is free but limited)
Common useWeb and SaaS applicationsEnterprise desktop and Windows infrastructure
ServerLinux and WindowsMostly Windows
StrengthLightweight, fast, low costAdvanced T-SQL, reporting and management tools

In my web-based and multi-tenant products I use MySQL/MariaDB; in desktop and enterprise systems built with Delphi I mostly use MS SQL Server.

Examples from my projects

Frequently asked questions

Can my existing slow database be fixed?

Yes. In most cases, the right indexes, query improvements and small structural changes give a significant speed boost without rewriting the system.

How should database backups be done?

Backups should be automatic, scheduled and copied off the server, and restoring them should be tested regularly.

Can my spreadsheet data be moved to the new system?

Yes. The data is cleaned, validated and imported into the new database structure.

For database design or performance problems, get in touch with me.

Still running things on spreadsheets and paper?

Quotes, stock, service, timesheets... Let us move manual work into one web panel.

~/keep-reading $

More articles

Expert Guides

What Is ERP Software? A Guide to Custom ERP Development

ERP software is an enterprise resource planning system that unites inventory, sales, purchasing, production and finance in one database. I explain the difference between off-the-shelf and custom ERP, the modules and the development process.

Expert Guides

What Is Weighbridge Automation? How Does Truck Scale Software Work?

Weighbridge automation is software that reads weights from a truck scale automatically, records them with plate, company and product details, and produces weighing tickets and e-waybills. I explain unattended weighing, licence plate recognition and ministry integrations.