Poll. Denormalization or not?

Recently, my professional colleague and I discussed on the Internet (more precisely, in LAN on Habré) the architecture of a certain system, and we had a dispute over one issue.



There is a warehouse where different materials are stored, there are documents for the receipt and consumption of materials, there are records in the documents with information "material, quantity", one-to-many relationship. The database contains a table with information about the current availability of materials in the warehouse, there is a table for documents and a table for their positions. Let's call them "current_stocks", "documents", "document_positions".



Should the table "current_stocks" be considered a data denormalization?



The colleague's argument is that the data in "current_stocks" can be calculated from documents for the entire lifetime of the system, so this is a denormalization.



My argument is that any current state can be calculated from the change history, so this is not a denormalization. Otherwise, the term "normalization" would not make sense. It refers specifically to modeling the current state. These are different models, "current_stocks" models the state of the warehouse, "document_positions" lines of text in documents.




All Articles