The organization database

0 like 0 dislike
Probably similar question was already asked, but do not know how to look.

Decided to make a database for cocktails.
The idea is very simple:
Sign A — the name of the cocktail, the text of the recipe, probably picture.
Plate B — ingredient, probably a picture, perhaps description

And another plate, which allows for each cocktail to watch all the cocktail ingredients and their quantity.
Accordingly, there is a problem — how to store for a cocktail all his ingredients with the quantities.

That is, the cocktail: ingredient 1: n1 ml ингридиент2: n2 ml...

Implement while going on PostпresSQL, but if the choice is bad, then tell me what is better and I'll change my mind.
Shell I write in Java, I would like to use SpringRoo to...

Thank you very much for your attention.
by | 8 views

1 Answer

0 like 0 dislike
Depends on the congestion of the resource.
— If to a couple thousand visitors a day, then You need the "classic" version:
+ Table "Cocktails": id, title, link, image, description.
+ Table "Ingredients": id, title, link, image, description.
+ Table Details: id, id_коктеля, id_индигриента, number.
— If the load is more than in the first case, suggest, or actively use caching (if possible) or to the first option to add a table of intermediate results (e.g., with serialized samples in ingredients or even complete data for actelem) and create functions forming them.
110,608 questions
257,186 answers
32,867 users