FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php DB rotation
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php DB rotation [message #176881 is a reply to message #176877] Tue, 31 January 2012 14:00 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
Jim Lee wrote:
> On Tue, 31 Jan 2012 04:36:37 +0100, Michael Fesser <netizen(at)gmx(dot)de>
> wrote:
>
>> .oO(Jim Lee)
>>
>>> I have a PHP server controller thatl read/write to Database table
>>>
>>> PHP server will start read / write to a new DB table every week/monday
>>> e.g.
>>> table-1-2-2012
>>> table-1-9-2012
>>> table-1-16-2012
>>> table-1-23-2012 ... etc
>>>
>>> I think of 2 ways to do the DB table rotation
>> The first question that comes to mind: Why table rotation? A good DBMS
>> can easily handle millions of records, if properly indexed.
>>
>> Or do you really have millions of new records each week? If not, just
>> add a timestamp to your records and you can easily filter them by date.
>>
>> Micha
>
> I must rotate to a new table, because there is another REST layer on
> top of the DB, the REST call will have a new table-name every week to
> read/write to.
>
> my main problem now, is how to reliably compute the DB table-name?
>
> using the server timestamp is a solution, I must make sure server time
> is acurrant though.

That you can do by simply tying the server in to ntp.

or you might be able to do an NTP call to the 'net directly..if it fails
I guess you use the old server name.

My machines do record reasonably weird ties at boot..I suppose they
start off the realtime clock - but that changes pretty quickly.

IIRC you CAN use ntp to update the realtime clocks on most hardware..so
as to minimise the difference.

http://linux.die.net/man/8/hwclock
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Freelance PHP Developer
Next Topic: enter search term via code?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 13:39:48 GMT 2024

Total time taken to generate the page: 0.04893 seconds