a suggestion to configure a script
am 17.04.2008 19:02:41 von nintesa
Hello from Italy!
I'm going to create a php script that registers and reports stats for
20/30 externals sites (with about 2.000 daily visitors each one).
I need to configure the tables (mysql) where I would store visitors data.
I need help to choose between these solutions:
a) two table visitors and visits whit a field site_id to distinguish
between monitorated sites visitors
b) two table for each site: site_1_visitors, site_1_visits,
site_2_visitors, site_2_visits etc...
What do you think about it?
Thanks!!
Re: a suggestion to configure a script
am 17.04.2008 19:09:29 von luiheidsgoeroe
On Thu, 17 Apr 2008 19:02:41 +0200, nintesa wrote:
> Hello from Italy!
>
> I'm going to create a php script that registers and reports stats for
> 20/30 externals sites (with about 2.000 daily visitors each one).
>
> I need to configure the tables (mysql) where I would store visitors data.
>
> I need help to choose between these solutions:
>
> a) two table visitors and visits whit a field site_id to distinguish
> between monitorated sites visitors
>
> b) two table for each site: site_1_visitors, site_1_visits,
> site_2_visitors, site_2_visits etc...
>
> What do you think about it?
This is a database question, which you should ask in database groups...
However: most flexible is a) (with offcourse an extra table 'sites'). Easy
to add & drop sites, and with the proper indexes it should be about as
quick. Duplication of similar tables like in b) is almost never a viable
solution.
--
Rik Wasmus
Re: a suggestion to configure a script
am 18.04.2008 02:04:10 von Michael Austin
Rik Wasmus wrote:
> On Thu, 17 Apr 2008 19:02:41 +0200, nintesa wrote:
>
>> Hello from Italy!
>>
>> I'm going to create a php script that registers and reports stats for
>> 20/30 externals sites (with about 2.000 daily visitors each one).
>>
>> I need to configure the tables (mysql) where I would store visitors data.
>>
>> I need help to choose between these solutions:
>>
>> a) two table visitors and visits whit a field site_id to distinguish
>> between monitorated sites visitors
>>
>> b) two table for each site: site_1_visitors, site_1_visits,
>> site_2_visitors, site_2_visits etc...
>>
>> What do you think about it?
>
> This is a database question, which you should ask in database groups...
>
> However: most flexible is a) (with offcourse an extra table 'sites').
> Easy to add & drop sites, and with the proper indexes it should be about
> as quick. Duplication of similar tables like in b) is almost never a
> viable solution.
As a database professional - I would concur. b) gets to be very messy
when trying to manage as in the fact that you must always modify your
code AND your database every time you add/drop a site. Option a) is a
lot more manageable.