I need a small help. I am new to postgres and django. I am creating a project in django where there will n number of clients and their data is saved into the database on monthly basis. So my doubts is should i go with only a single table and save all the data inside it or do I have an option to create individual tables dynamically as the user approaches and then save the values into those table?
1 Answer
In fact you do not need to create a special table for each customer. SQL databases is designed in a manner to keep all similar data in one table. It is much easier to work with them in such a way.
At a moment I'd like to recommend to read about relational databases to better understand ways how to store data in it. Then you'll see how to better design application and data storage.
3 Comments
Vivek Cu
Thanks for the advice @Eugene, but what i was thinking to store them as individually as the table size wont grow large(as i need monthly data to be stored) and also i can keep the data for individual clients as separate. I just wanted to know if there was a way possible to do that.
Eugene Lisitsky
@VivekCu, I understand your idea. But I'm not sure it'll be best solution for a long term. Lots of tables are much harder to maintain. BTW, what problem do you want to solve? May be there's some standard solutions.
Vivek Cu
Thanks for the solution @Eugene. I guess i will move ahead with a single table for storing all the values.
Clienttable andcountrytable and just like them