Brain Dump

Database Denormalisation

Tags
soft-eng

Is the act of un-(/brain/20210815023015-database_normalisation/) a database. This could be [see page 22, valuable] to increase the efficiency of searches (fewer joins) or to decrease the fragmentation of data (fewer tables).

Denormalisation can be done by:

  • Reducing the number of tables.

    Approaches involve avoiding reconstructing whole objects in memory from fragmented table data, resulting in fewer joins.

    • Flattening the database structure into one table leading to wasted space due to excess null values.
    • Flatenning composition structures into one table at the cost of replicating the part data many times in the whole.
  • Optimising the access paths

    Saving time when searching resulting in fewer joins.

    • Retains redundant access path through the data but at the cost of additional FKs and the risk of inconsistency between them.