mysql - Database Design - Is redundancy better than adding more relationship? -
hi wonder 1 of these database designs better:
i have shopping db, has 2 tables: categories
, brands
. both of tables have columns: name
, description
, , image_url
.
so okay keep duplicate column? or should create table stores information?
to visualize better, here's chart
the redundant one
| categories | | brands | | - name | | - name | | - description | | - description | | - image_url | | - image_url |
or adding new table?
| categories | | informations | | brands | | |--->| - name |<-----| | | - info_id | | - description | | - info_id | | - image_url |
thanks
in case it's not same information. it's category_name, category_description, brand_name , brand_description.
creating table keep generic information many things bad idea.
when comes discussion (de)normalisation it's considered better design normalise data , start such design. data evolves , grows might necessary de-normalise tables data retrieval can faster @ cost of storage space , risk of loosing data consistency.
Comments
Post a Comment