2

I am working on a diet app project.

I went through different diet apps available on play store like myfitnesspal. In the case of myfitnesspal, the app has a primary database of food for the Calorie and nutritional information of different kind of foods. It has also got features like Diary. This feature stores all the food entries being made everyday. In the recipes section where user can make custom foods, dishes(combination of foods), meals(combination if dishes).

Now my question is...

should I create three databases differently( for primary food database, for keeping all the daily food entries made by user(DIARY) and for the customized food/dishes/meals user create.

or

create a single database and make different tables for three of those(primary, diary, custom).

Please suggest me which one should i choose for best results and suggest a reference for doing that. Please try to answer in detail and clearly.

Thanks in advance.

PedroHawk
  • 622
  • 5
  • 19
  • or single db with a single table? after all, the data structure for primary, diary and custom is the same, right? – pskink May 07 '15 at 15:57
  • 1
    i suggest on a single database. Its important to define an hierarchy on food entrys (primary food <- meals <- customize meals ...) to optimize your database (database normalization) – PedroHawk May 07 '15 at 16:04
  • @pskink data structure is same but it needs to be stored at different places. in case of primary food db only the calories and nutrients of food are to be stored( user only needs it while logging food), diary is like history of what user have logged so it needs to be store at another place and i will be a group of food(or meals) logged over days. Custom combines different foods to form new dishes and different dishes and foods to form new meals so it is again different from food... If you think i have got you wrong **answer the question** with some example code –  May 07 '15 at 16:12
  • @PedroHawk I got what you said about database normalization still you are very unclear to main question because i am not talking about custom section only, i am talking about the solution for collective use of (primary, diary, custom) data. Read my previous comment to 'pskink' –  May 07 '15 at 16:19

0 Answers0