liveBook · Manning

Database design

As explained in Grokking Relational Database Design

Database design is the process of defining a database's structures, relationships, constraints, and organization to meet data requirements.

Database design turns data requirements into a well-structured, efficient database. It organizes data so applications can query and change it reliably, while aiming for consistency, integrity, maintainability, performance, security, and room to grow. Poor structure can produce duplicated data, slow queries, bugs, and a frustrating user experience. section 1.1 section 3.2

A practical design process has three connected phases:

  • Gather requirements by interviewing people who use the data, studying existing databases, and examining current information-management practices. section 3.16
  • Analyze requirements and design a blueprint for the database’s structure and functionality. section 3.16
  • Implement, integrate, and test the database against that blueprint. section 3.16

Start requirements work with the real workflow, not guesses. Identify the subjects involved, their characteristics, and the relationships among them. Ask for demonstrations and authentic, preferably anonymized, data samples; samples help verify the attributes and data types the design needs. section 3.14 section 3.16

Replacing an inventory spreadsheet

When an inventory spreadsheet will be replaced, ask the purchasing team to demonstrate ordering a batch, entering a new product, updating inventory, and removing records. The walkthrough exposes details that an interview alone may miss, while the spreadsheet data helps determine attributes and data types. section 3.14

Design decisions become concrete through entities, attributes, primary keys, data types, relationships, normalization, constraints, and cascade behavior. For example, a table that mixes customer and product information can create delete anomalies and insertion anomalies: deleting a product may also remove its only customer record, while a product with no buyer cannot be added. section 1.3 section 4.0 section 6.0

SQL is useful for creating, modifying, and querying tables, although a design can also be turned into database scripts with graphical tools. Common RDBMSs use largely consistent SQL, with vendor-specific variations. Generative AI can accelerate drafting and communication, but its output needs step-by-step verification and revision against the requirements. section 1.4 section 8.13

A SQL-generated diagram makes a text-based design easier to review and share with collaborators. section 8.6

How Grokking Relational Database Design covers it

How deep it goes
Walks through requirement gathering, structural planning, implementation, testing, normalization, and constraints rather than stopping at definitions.
Examples
Uses an online-store inventory spreadsheet and a mixed customer-product table to expose missing requirements and data anomalies.
What it assumes
Starts from zero with no assumed database or programming knowledge, while teaching relational database and SQL basics.
What you can do after
Build it from scratch by gathering requirements, planning structure, implementing the database, and validating it against a design blueprint.
How it connects
Connects relational databases, SQL, requirement gathering, entities, attributes, primary keys, normalization, constraints, data integrity, and scalability.

Also explained in

Compare how 2 books explain database design →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Relational Database Design. The section links point to the parts of the book it draws on.