I'm building an application and I'm having trouble making a choice about how is the best way to access multiple times to static data in a django app. My experience in the field is close to zero so I could use some help.
The app basically consists in a drag & drop of foods. When you drag a food to a determined place(breakfast for example) differents values gets updated: total breakfast calories, total day nutrients(Micro/ Macro), total day calories, ...That's why I think the way I store and access the data it's pretty important performance speaking. This is an excerpt of the json file I'm currently using: foods.json { "112": { "type": "Vegetables", "description": "Mushrooms", "nutrients": { "Niacin": { "unit": "mg", "group": "Vitamins", "value": 3.79 }, "Lysine": { "units": "g", "group": "Amino Acids", "value": 0.123 }, ... (+40 nutrients) "amount": 1, "unit": "cup whole", "grams": 87.0 } } I've thought about different options: 1) JSON(The one I'm currently using): Every time I drag a food to a "droppable" place, I call a getJSON function to access the food data and then update the corresponding values. This file has a 2mb size, but it surely will increase as I add more foods to it. I'm using this option because it was the most quickest to begin to build the app but I don't think it's a good choice for the live app. 2) RDBMS with normalized fields: I could create two models: Food and Nutrient, each food has 40+ nutrients related by a FK. The problem I see with this is that every time a food data request is made, the app will hit the db a lot of times to retrieve it. 3) RDBMS with picklefield: This is the option I'm actually considering. I could create a Food models and put the nutrients in a picklefield. 4) Something with Redis/Django Cache system: I'll dive more deeply into this option. I've read some things about them but I don't clearly know if there's some way to use them to solve the problem I have. Thanks in advance, Mariano. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.