This is my first post.
I need a help on db designing for one requirement.
1.) For a domain name i will be collecting three statistics every day for one year.
I thought of creating table for a domain name with each column (for each date). These column will point to a table which willl contain three statistics of a day. But i feel that is an inefficient way of doing as the tables will grow up over the years.
Totaly agree with guelphdad ...
One statistic three times a day, or three different statistics each day ? I suppose the latter ...
But here just a hint how to anyway:
1. Being more than 200% sure, the requirements will not change ... (or 'just forget it, when they see it working they want more !')
Create a single table:
Date, Item1, Item2, Item3
2. Willing to add some db know how and be the laughing system owner when they want more.
Create three tables:
- one for storing domain characteristics like name, owner, etc. Make sure to include an ID as primary key, say DomID.
- one for storing the type of statistics you want to measure, again make sure there is an StatID as primary key field in this table.
- one for storing the actual measurements of the different statistics, including a foreign key to the first two tables by using the DomID and StatID. Ofcourse don't forget to store the date (or better date and time) here as well.
... and now let the users come tell you they want you to monitor more than one domain or another 700 statistics of those 429 domains they own. You'll be ready for them ... at least, that's what I would do ...
> SELECT * FROM users WHERE clue > 0;
Empty set (0.00 sec)