E
Eddie's Bakery and Cafe'
Hi, I have a database design question. A friend and I were having lunch and
got into a database table discussion. Neither one of us is experienced in
database design or database application development. I showed my friend the
database application that I am developing for a bakery/cafe that I plan on
opening. My friend suggested I change my table design. This led into a
discussion about which design is more efficient, the one that I am using or
my friend’s design.
My application is similar to designing a table structure for a family tree.
There is a hierarchy of family members (great grandparent, grandparent,
parent, and children). There are only leaf nodes in the family tree for the
children, not the parents or grandparents.
Since I am opening a Bakery/Cafe, you can imagine my application is
analogous to the family tree example; but instead of people, it uses recipes.
The recipes are accessed through a tree similar to the family tree analogy.
For example, a "Chewy Chocolate Chip" Cookie recipe might be referenced by
defining a recipe path-like structure similar to:
Bakery/Cookies/Classic/Chocolate.
Using this idea, one might design four tables to access the cookie recipe
(tblBakery, tblCookies, tblClassic, tblChocolate). The cookie recipe is in
the “leaf†table (i.e., tblChewyChoclateChip) pointed to by the four tables.
In my design I don't actual use these table names, but I included them for
understanding.
I am using a table structure similar to: "tblMenu", "tblMenuCategory",
"tblRecipeType", "tblRecipeCategory" and for the actual recipes, I defined a
table called "tblRecipeNames". Each table has primary/foreign keys and the
relationships between the tables are a one to many (for one entry in the
“tblMenu†table, there can be several entries in the “tblMenuCategory†table
(i.e., Bread points to Rye, Pan, Whole Wheat, Artisan, Quick bread, etc)
My friend suggested that I use one table for all the recipe hierarchy
information, similar to a link list, and one table for the recipes
themselves. In my approach I defined five tables (four tables used for the
recipe path and one table used for the recipes). In my friend’s approach
there are only two tables in the design, one for the recipe path and one for
the recipes. My design steps through four tables in order to access the
recipes. In my friend’s design, the recipes are not limited to any nesting
order because the recipe hierarchy table is structured like a link-list. My
friend’s approach sounds simple enough; however, I’m concerned about table
normalization and the tables becoming too large and unmanageable.
If you have any suggestions or comments on this issue I would appreciate
your feedback.
Regards, Eddie
got into a database table discussion. Neither one of us is experienced in
database design or database application development. I showed my friend the
database application that I am developing for a bakery/cafe that I plan on
opening. My friend suggested I change my table design. This led into a
discussion about which design is more efficient, the one that I am using or
my friend’s design.
My application is similar to designing a table structure for a family tree.
There is a hierarchy of family members (great grandparent, grandparent,
parent, and children). There are only leaf nodes in the family tree for the
children, not the parents or grandparents.
Since I am opening a Bakery/Cafe, you can imagine my application is
analogous to the family tree example; but instead of people, it uses recipes.
The recipes are accessed through a tree similar to the family tree analogy.
For example, a "Chewy Chocolate Chip" Cookie recipe might be referenced by
defining a recipe path-like structure similar to:
Bakery/Cookies/Classic/Chocolate.
Using this idea, one might design four tables to access the cookie recipe
(tblBakery, tblCookies, tblClassic, tblChocolate). The cookie recipe is in
the “leaf†table (i.e., tblChewyChoclateChip) pointed to by the four tables.
In my design I don't actual use these table names, but I included them for
understanding.
I am using a table structure similar to: "tblMenu", "tblMenuCategory",
"tblRecipeType", "tblRecipeCategory" and for the actual recipes, I defined a
table called "tblRecipeNames". Each table has primary/foreign keys and the
relationships between the tables are a one to many (for one entry in the
“tblMenu†table, there can be several entries in the “tblMenuCategory†table
(i.e., Bread points to Rye, Pan, Whole Wheat, Artisan, Quick bread, etc)
My friend suggested that I use one table for all the recipe hierarchy
information, similar to a link list, and one table for the recipes
themselves. In my approach I defined five tables (four tables used for the
recipe path and one table used for the recipes). In my friend’s approach
there are only two tables in the design, one for the recipe path and one for
the recipes. My design steps through four tables in order to access the
recipes. In my friend’s design, the recipes are not limited to any nesting
order because the recipe hierarchy table is structured like a link-list. My
friend’s approach sounds simple enough; however, I’m concerned about table
normalization and the tables becoming too large and unmanageable.
If you have any suggestions or comments on this issue I would appreciate
your feedback.
Regards, Eddie