Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11649 > unrolled thread

Java DB rotation

Started byJim Lee <jimlee2907@yahoo.com>
First post2012-01-30 18:08 -0800
Last post2012-02-08 02:08 +1100
Articles 20 on this page of 25 — 8 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:08 -0800
    Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:12 -0500
      Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:14 -0500
        Re: Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:20 -0800
          Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:34 -0500
          Re: Java DB rotation Robert Klemme <shortcutter@googlemail.com> - 2012-01-31 08:36 +0100
      Re: Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:17 -0800
        Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:20 -0500
          Re: Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:23 -0800
            Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:31 -0500
    Re: Java DB rotation Martin Gregorie <martin@address-in-sig.invalid> - 2012-01-31 02:21 +0000
      Re: Java DB rotation Jim Lee <jimlee2907@yahoo.com> - 2012-01-30 18:24 -0800
        Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:32 -0500
          Re: Java DB rotation Robert Klemme <shortcutter@googlemail.com> - 2012-01-31 08:38 +0100
            Re: Java DB rotation Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-01-31 12:57 -0600
              Re: Java DB rotation Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-01-31 13:03 -0600
                Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-31 20:32 -0500
                  Re: Java DB rotation Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2012-02-01 13:49 -0600
                    Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-02-01 19:23 -0500
              Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-31 20:31 -0500
            Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-31 20:30 -0500
    Re: Java DB rotation Arne Vajhøj <arne@vajhoej.dk> - 2012-01-30 21:35 -0500
      Re: Java DB rotation Lew <noone@lewscanon.com> - 2012-01-30 22:54 -0800
    Re: Java DB rotation George Neuner <gneuner2@comcast.net> - 2012-02-02 14:05 -0500
    Re: Java DB rotation Rajiv Gupta <rajiv@invalid.com> - 2012-02-08 02:08 +1100

Page 1 of 2  [1] 2  Next page →


#11649 — Java DB rotation

FromJim Lee <jimlee2907@yahoo.com>
Date2012-01-30 18:08 -0800
SubjectJava DB rotation
Message-ID<n7jei7582sh0m08frucvasubaaiplnvc2s@4ax.com>
I have a Java server controller that read/write to Database table

Java 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

1) check the server timestamp, if today's date is week of 1-23-2012,
then read/write to table-1-23-

2012 

2) have a unix corn job run every monday to generate a text file on
Java server with DB table named on 

that date -  on each Java request, check the text file's table name -
then read/write to that DB table

any other solution to DB table rotation?

the first way check timestamp have a drawback when server's time is
not set to correct time, since 

there are many Java server running for load balance, it's not a good
idea.

the second way is a better solution, but request additional setup -
cron job 

[toc] | [next] | [standalone]


#11650

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-01-30 21:12 -0500
Message-ID<4f274dff$0$285$14726298@news.sunsite.dk>
In reply to#11649
On 1/30/2012 9:08 PM, Jim Lee wrote:
> I have a Java server controller that read/write to Database table
>
> Java 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
>
> 1) check the server timestamp, if today's date is week of 1-23-2012,
> then read/write to table-1-23-
>
> 2012
>
> 2) have a unix corn job run every monday to generate a text file on
> Java server with DB table named on
>
> that date -  on each Java request, check the text file's table name -
> then read/write to that DB table
>
> any other solution to DB table rotation?
>
> the first way check timestamp have a drawback when server's time is
> not set to correct time, since
>
> there are many Java server running for load balance, it's not a good
> idea.
>
> the second way is a better solution, but request additional setup -
> cron job

I can not see any any problems with construction the table
name every time you need it.

That string formatting will be insignificant compared to
the actual database operation.

And it will be far more expensive to read from a file.

So definitely #1.

Arne

[toc] | [prev] | [next] | [standalone]


#11651

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-01-30 21:14 -0500
Message-ID<4f274e7e$0$285$14726298@news.sunsite.dk>
In reply to#11650
On 1/30/2012 9:12 PM, Arne Vajhøj wrote:
> On 1/30/2012 9:08 PM, Jim Lee wrote:
>> I have a Java server controller that read/write to Database table
>>
>> Java 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
>>
>> 1) check the server timestamp, if today's date is week of 1-23-2012,
>> then read/write to table-1-23-
>>
>> 2012
>>
>> 2) have a unix corn job run every monday to generate a text file on
>> Java server with DB table named on
>>
>> that date - on each Java request, check the text file's table name -
>> then read/write to that DB table
>>
>> any other solution to DB table rotation?
>>
>> the first way check timestamp have a drawback when server's time is
>> not set to correct time, since
>>
>> there are many Java server running for load balance, it's not a good
>> idea.
>>
>> the second way is a better solution, but request additional setup -
>> cron job
>
> I can not see any any problems with construction the table
> name every time you need it.
>
> That string formatting will be insignificant compared to
> the actual database operation.
>
> And it will be far more expensive to read from a file.
>
> So definitely #1.

But also consider if you really want to switch table like
that.

Why not just use the same table all the time with a column
for the period?

For most cases that would be the best solution. Exceptions
do exist.

Arne

[toc] | [prev] | [next] | [standalone]


#11655

FromJim Lee <jimlee2907@yahoo.com>
Date2012-01-30 18:20 -0800
Message-ID<gujei7pegoj6em3i594etit48r12igtmrk@4ax.com>
In reply to#11651
On Mon, 30 Jan 2012 21:14:21 -0500, Arne Vajh?j <arne@vajhoej.dk>
wrote:

>On 1/30/2012 9:12 PM, Arne Vajh?j wrote:
>> On 1/30/2012 9:08 PM, Jim Lee wrote:
>>> I have a Java server controller that read/write to Database table
>>>
>>> Java 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
>>>
>>> 1) check the server timestamp, if today's date is week of 1-23-2012,
>>> then read/write to table-1-23-
>>>
>>> 2012
>>>
>>> 2) have a unix corn job run every monday to generate a text file on
>>> Java server with DB table named on
>>>
>>> that date - on each Java request, check the text file's table name -
>>> then read/write to that DB table
>>>
>>> any other solution to DB table rotation?
>>>
>>> the first way check timestamp have a drawback when server's time is
>>> not set to correct time, since
>>>
>>> there are many Java server running for load balance, it's not a good
>>> idea.
>>>
>>> the second way is a better solution, but request additional setup -
>>> cron job
>>
>> I can not see any any problems with construction the table
>> name every time you need it.
>>
>> That string formatting will be insignificant compared to
>> the actual database operation.
>>
>> And it will be far more expensive to read from a file.
>>
>> So definitely #1.
>
>But also consider if you really want to switch table like
>that.
>
>Why not just use the same table all the time with a column
>for the period?
>
>For most cases that would be the best solution. Exceptions
>do exist.
>
>Arne



I must use a new table 

[toc] | [prev] | [next] | [standalone]


#11660

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-01-30 21:34 -0500
Message-ID<4f27532a$0$283$14726298@news.sunsite.dk>
In reply to#11655
On 1/30/2012 9:20 PM, Jim Lee wrote:
> On Mon, 30 Jan 2012 21:14:21 -0500, Arne Vajh?j<arne@vajhoej.dk>
> wrote:
>> On 1/30/2012 9:12 PM, Arne Vajh?j wrote:
>>> On 1/30/2012 9:08 PM, Jim Lee wrote:
>>>> I have a Java server controller that read/write to Database table
>>>>
>>>> Java 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
>>>>
>>>> 1) check the server timestamp, if today's date is week of 1-23-2012,
>>>> then read/write to table-1-23-
>>>>
>>>> 2012
>>>>
>>>> 2) have a unix corn job run every monday to generate a text file on
>>>> Java server with DB table named on
>>>>
>>>> that date - on each Java request, check the text file's table name -
>>>> then read/write to that DB table
>>>>
>>>> any other solution to DB table rotation?
>>>>
>>>> the first way check timestamp have a drawback when server's time is
>>>> not set to correct time, since
>>>>
>>>> there are many Java server running for load balance, it's not a good
>>>> idea.
>>>>
>>>> the second way is a better solution, but request additional setup -
>>>> cron job
>>>
>>> I can not see any any problems with construction the table
>>> name every time you need it.
>>>
>>> That string formatting will be insignificant compared to
>>> the actual database operation.
>>>
>>> And it will be far more expensive to read from a file.
>>>
>>> So definitely #1.
>>
>> But also consider if you really want to switch table like
>> that.
>>
>> Why not just use the same table all the time with a column
>> for the period?
>>
>> For most cases that would be the best solution. Exceptions
>> do exist.
>
> I must use a new table

New tables does not solve a business problem.

It is something invented inside the IT org.

It can be changed if there is a desire to do so.

Arne

[toc] | [prev] | [next] | [standalone]


#11671

FromRobert Klemme <shortcutter@googlemail.com>
Date2012-01-31 08:36 +0100
Message-ID<9opjvbFpfhU1@mid.individual.net>
In reply to#11655
On 31.01.2012 03:20, Jim Lee wrote:
> On Mon, 30 Jan 2012 21:14:21 -0500, Arne Vajh?j<arne@vajhoej.dk>

>> But also consider if you really want to switch table like
>> that.
>>
>> Why not just use the same table all the time with a column
>> for the period?
>>
>> For most cases that would be the best solution. Exceptions
>> do exist.

+1

> I must use a new table

Why?

	robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#11652

FromJim Lee <jimlee2907@yahoo.com>
Date2012-01-30 18:17 -0800
Message-ID<ikjei792ctlig62fmj6lnifthuq43bkcg6@4ax.com>
In reply to#11650
On Mon, 30 Jan 2012 21:12:14 -0500, Arne Vajh?j <arne@vajhoej.dk>
wrote:

>On 1/30/2012 9:08 PM, Jim Lee wrote:
>> I have a Java server controller that read/write to Database table
>>
>> Java 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
>>
>> 1) check the server timestamp, if today's date is week of 1-23-2012,
>> then read/write to table-1-23-
>>
>> 2012
>>
>> 2) have a unix corn job run every monday to generate a text file on
>> Java server with DB table named on
>>
>> that date -  on each Java request, check the text file's table name -
>> then read/write to that DB table
>>
>> any other solution to DB table rotation?
>>
>> the first way check timestamp have a drawback when server's time is
>> not set to correct time, since
>>
>> there are many Java server running for load balance, it's not a good
>> idea.
>>
>> the second way is a better solution, but request additional setup -
>> cron job
>
>I can not see any any problems with construction the table
>name every time you need it.

to construct the table name, i need to use the server timestamp, what
if the server time is incorrect? then everything is messed up?  On
linux, is the server time always in sync with internet time server? or
it's depended on the motherboard BIOS time?

>
>That string formatting will be insignificant compared to
>the actual database operation.
>
>And it will be far more expensive to read from a file.
>
>So definitely #1.
>
>Arne

[toc] | [prev] | [next] | [standalone]


#11653

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-01-30 21:20 -0500
Message-ID<4f274fde$0$285$14726298@news.sunsite.dk>
In reply to#11652
On 1/30/2012 9:17 PM, Jim Lee wrote:
> On Mon, 30 Jan 2012 21:12:14 -0500, Arne Vajh?j<arne@vajhoej.dk>
> wrote:
>
>> On 1/30/2012 9:08 PM, Jim Lee wrote:
>>> I have a Java server controller that read/write to Database table
>>>
>>> Java 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
>>>
>>> 1) check the server timestamp, if today's date is week of 1-23-2012,
>>> then read/write to table-1-23-
>>>
>>> 2012
>>>
>>> 2) have a unix corn job run every monday to generate a text file on
>>> Java server with DB table named on
>>>
>>> that date -  on each Java request, check the text file's table name -
>>> then read/write to that DB table
>>>
>>> any other solution to DB table rotation?
>>>
>>> the first way check timestamp have a drawback when server's time is
>>> not set to correct time, since
>>>
>>> there are many Java server running for load balance, it's not a good
>>> idea.
>>>
>>> the second way is a better solution, but request additional setup -
>>> cron job
>>
>> I can not see any any problems with construction the table
>> name every time you need it.
>
> to construct the table name, i need to use the server timestamp, what
> if the server time is incorrect? then everything is messed up?  On
> linux, is the server time always in sync with internet time server? or
> it's depended on the motherboard BIOS time?

If you can not get the time correctly to construct a tablename
then you can not get the time correctly to write to the file.

You can setup NTP to synch time.

But does it matter if one server is 2 seconds off?

Arne

[toc] | [prev] | [next] | [standalone]


#11656

FromJim Lee <jimlee2907@yahoo.com>
Date2012-01-30 18:23 -0800
Message-ID<j3kei798m5q5knvlfrvu4t1urnl27tn66f@4ax.com>
In reply to#11653
1-2 sec off is not matter


On Mon, 30 Jan 2012 21:20:14 -0500, Arne Vajh?j <arne@vajhoej.dk>
wrote:


>On 1/30/2012 9:17 PM, Jim Lee wrote:
>> On Mon, 30 Jan 2012 21:12:14 -0500, Arne Vajh?j<arne@vajhoej.dk>
>> wrote:
>>
>>> On 1/30/2012 9:08 PM, Jim Lee wrote:
>>>> I have a Java server controller that read/write to Database table
>>>>
>>>> Java 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
>>>>
>>>> 1) check the server timestamp, if today's date is week of 1-23-2012,
>>>> then read/write to table-1-23-
>>>>
>>>> 2012
>>>>
>>>> 2) have a unix corn job run every monday to generate a text file on
>>>> Java server with DB table named on
>>>>
>>>> that date -  on each Java request, check the text file's table name -
>>>> then read/write to that DB table
>>>>
>>>> any other solution to DB table rotation?
>>>>
>>>> the first way check timestamp have a drawback when server's time is
>>>> not set to correct time, since
>>>>
>>>> there are many Java server running for load balance, it's not a good
>>>> idea.
>>>>
>>>> the second way is a better solution, but request additional setup -
>>>> cron job
>>>
>>> I can not see any any problems with construction the table
>>> name every time you need it.
>>
>> to construct the table name, i need to use the server timestamp, what
>> if the server time is incorrect? then everything is messed up?  On
>> linux, is the server time always in sync with internet time server? or
>> it's depended on the motherboard BIOS time?
>
>If you can not get the time correctly to construct a tablename
>then you can not get the time correctly to write to the file.
>
>You can setup NTP to synch time.
>
>But does it matter if one server is 2 seconds off?
>
>Arne
>

[toc] | [prev] | [next] | [standalone]


#11658

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-01-30 21:31 -0500
Message-ID<4f275280$0$283$14726298@news.sunsite.dk>
In reply to#11656
On 1/30/2012 9:23 PM, Jim Lee wrote:
> On Mon, 30 Jan 2012 21:20:14 -0500, Arne Vajh?j<arne@vajhoej.dk>
> wrote:
>> On 1/30/2012 9:17 PM, Jim Lee wrote:
>>> On Mon, 30 Jan 2012 21:12:14 -0500, Arne Vajh?j<arne@vajhoej.dk>
>>> wrote:
>>>
>>>> On 1/30/2012 9:08 PM, Jim Lee wrote:
>>>>> I have a Java server controller that read/write to Database table
>>>>>
>>>>> Java 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
>>>>>
>>>>> 1) check the server timestamp, if today's date is week of 1-23-2012,
>>>>> then read/write to table-1-23-
>>>>>
>>>>> 2012
>>>>>
>>>>> 2) have a unix corn job run every monday to generate a text file on
>>>>> Java server with DB table named on
>>>>>
>>>>> that date -  on each Java request, check the text file's table name -
>>>>> then read/write to that DB table
>>>>>
>>>>> any other solution to DB table rotation?
>>>>>
>>>>> the first way check timestamp have a drawback when server's time is
>>>>> not set to correct time, since
>>>>>
>>>>> there are many Java server running for load balance, it's not a good
>>>>> idea.
>>>>>
>>>>> the second way is a better solution, but request additional setup -
>>>>> cron job
>>>>
>>>> I can not see any any problems with construction the table
>>>> name every time you need it.
>>>
>>> to construct the table name, i need to use the server timestamp, what
>>> if the server time is incorrect? then everything is messed up?  On
>>> linux, is the server time always in sync with internet time server? or
>>> it's depended on the motherboard BIOS time?
>>
>> If you can not get the time correctly to construct a tablename
>> then you can not get the time correctly to write to the file.
>>
>> You can setup NTP to synch time.
>>
>> But does it matter if one server is 2 seconds off?
 >
> 1-2 sec off is not matter

Synching time today is not difficult.

Arne

[toc] | [prev] | [next] | [standalone]


#11654

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-01-31 02:21 +0000
Message-ID<jg7j6n$8ho$1@localhost.localdomain>
In reply to#11649
On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:

> I have a Java server controller that read/write to Database table
> 
> Java 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
>
What problem are you using table rotation to solve?

What would prevent you from using a single table containing datestamped 
rows which are archived and/or deleted the rows after "cycle length" days?


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#11657

FromJim Lee <jimlee2907@yahoo.com>
Date2012-01-30 18:24 -0800
Message-ID<s4kei7lifs11l4l7gb0ci5vde0bh2qld4k@4ax.com>
In reply to#11654
On Tue, 31 Jan 2012 02:21:11 +0000 (UTC), Martin Gregorie
<martin@address-in-sig.invalid> wrote:

>On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:
>
>> I have a Java server controller that read/write to Database table
>> 
>> Java 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
>>
>What problem are you using table rotation to solve?
>
>What would prevent you from using a single table containing datestamped 
>rows which are archived and/or deleted the rows after "cycle length" days?

my main problem is how to make sure "how to get the correct table name
to read/write to" depending what day in the week

start a new DB table is a must since it's going through some other
REST backend layer

[toc] | [prev] | [next] | [standalone]


#11659

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-01-30 21:32 -0500
Message-ID<4f2752d1$0$283$14726298@news.sunsite.dk>
In reply to#11657
On 1/30/2012 9:24 PM, Jim Lee wrote:
> On Tue, 31 Jan 2012 02:21:11 +0000 (UTC), Martin Gregorie
> <martin@address-in-sig.invalid>  wrote:
>> On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:
>>> I have a Java server controller that read/write to Database table
>>>
>>> Java 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
>>>
>> What problem are you using table rotation to solve?
>>
>> What would prevent you from using a single table containing datestamped
>> rows which are archived and/or deleted the rows after "cycle length" days?
>
> my main problem is how to make sure "how to get the correct table name
> to read/write to" depending what day in the week
>
> start a new DB table is a must since it's going through some other
> REST backend layer

There is nothing in REST that requires such a table structure.

And it would be better to fix the bad code requiring such
a table rollover than to make other apps bad to work with it.

Arne

[toc] | [prev] | [next] | [standalone]


#11672

FromRobert Klemme <shortcutter@googlemail.com>
Date2012-01-31 08:38 +0100
Message-ID<9opk4aFpfhU2@mid.individual.net>
In reply to#11659
On 31.01.2012 03:32, Arne Vajhøj wrote:
> On 1/30/2012 9:24 PM, Jim Lee wrote:
>> On Tue, 31 Jan 2012 02:21:11 +0000 (UTC), Martin Gregorie
>> <martin@address-in-sig.invalid> wrote:
>>> On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:
>>>> I have a Java server controller that read/write to Database table
>>>>
>>>> Java 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
>>>>
>>> What problem are you using table rotation to solve?
>>>
>>> What would prevent you from using a single table containing datestamped
>>> rows which are archived and/or deleted the rows after "cycle length"
>>> days?
>>
>> my main problem is how to make sure "how to get the correct table name
>> to read/write to" depending what day in the week
>>
>> start a new DB table is a must since it's going through some other
>> REST backend layer
>
> There is nothing in REST that requires such a table structure.
>
> And it would be better to fix the bad code requiring such
> a table rollover than to make other apps bad to work with it.

Another question: Jim, what database are you using?  If the instance 
requiring multiple tables is afraid of volume the typical solution to 
this issue is called "partitioning".  If your database supports it, 
that's typically the way to go for such kind of data.

Cheers

	robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#11678

FromChris Riesbeck <Chris.Riesbeck@gmail.com>
Date2012-01-31 12:57 -0600
Message-ID<9oqrt9FeibU1@mid.individual.net>
In reply to#11672
On 1/31/2012 1:38 AM, Robert Klemme wrote:
> On 31.01.2012 03:32, Arne Vajhøj wrote:
>> On 1/30/2012 9:24 PM, Jim Lee wrote:
>>> On Tue, 31 Jan 2012 02:21:11 +0000 (UTC), Martin Gregorie
>>> <martin@address-in-sig.invalid> wrote:
>>>> On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:
>>>>> I have a Java server controller that read/write to Database table
>>>>>
>>>>> Java 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
>>>>>
>>>> What problem are you using table rotation to solve?
>>>>
>>>> What would prevent you from using a single table containing datestamped
>>>> rows which are archived and/or deleted the rows after "cycle length"
>>>> days?
>>>
>>> my main problem is how to make sure "how to get the correct table name
>>> to read/write to" depending what day in the week
>>>
>>> start a new DB table is a must since it's going through some other
>>> REST backend layer
>>
>> There is nothing in REST that requires such a table structure.
>>
>> And it would be better to fix the bad code requiring such
>> a table rollover than to make other apps bad to work with it.
>
> Another question: Jim, what database are you using? If the instance
> requiring multiple tables is afraid of volume the typical solution to
> this issue is called "partitioning". If your database supports it,
> that's typically the way to go for such kind of data.

Pretty much every response from the OP has suggested either really bad 
intra-team communication (distributed team?), or a system architect 
angling for an appearance on the Daily WTF.



[toc] | [prev] | [next] | [standalone]


#11679

FromChris Riesbeck <Chris.Riesbeck@gmail.com>
Date2012-01-31 13:03 -0600
Message-ID<9oqs7gFeibU3@mid.individual.net>
In reply to#11678
On 1/31/2012 12:57 PM, Chris Riesbeck wrote:
> On 1/31/2012 1:38 AM, Robert Klemme wrote:
>> On 31.01.2012 03:32, Arne Vajhøj wrote:
>>> On 1/30/2012 9:24 PM, Jim Lee wrote:
>>>> On Tue, 31 Jan 2012 02:21:11 +0000 (UTC), Martin Gregorie
>>>> <martin@address-in-sig.invalid> wrote:
>>>>> On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:
>>>>>> I have a Java server controller that read/write to Database table
>>>>>>
> Pretty much every response from the OP has suggested either really bad
> intra-team communication (distributed team?), or a system architect
> angling for an appearance on the Daily WTF.
>

I change my mind. The same poster made the same query on comp.lang.php 
but said

> 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

I now hypothesize trolling.

[toc] | [prev] | [next] | [standalone]


#11690

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-01-31 20:32 -0500
Message-ID<4f28963d$0$283$14726298@news.sunsite.dk>
In reply to#11679
On 1/31/2012 2:03 PM, Chris Riesbeck wrote:
> On 1/31/2012 12:57 PM, Chris Riesbeck wrote:
>> On 1/31/2012 1:38 AM, Robert Klemme wrote:
>>> On 31.01.2012 03:32, Arne Vajhøj wrote:
>>>> On 1/30/2012 9:24 PM, Jim Lee wrote:
>>>>> On Tue, 31 Jan 2012 02:21:11 +0000 (UTC), Martin Gregorie
>>>>> <martin@address-in-sig.invalid> wrote:
>>>>>> On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:
>>>>>>> I have a Java server controller that read/write to Database table
>>>>>>>
>> Pretty much every response from the OP has suggested either really bad
>> intra-team communication (distributed team?), or a system architect
>> angling for an appearance on the Daily WTF.
>
> I change my mind. The same poster made the same query on comp.lang.php
> but said
>
>> 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
>
> I now hypothesize trolling.

It could be trolling.

Or he just want both a Java and a PHP view on things.

Out of curiosity: did the PHP folks answer similar to us?

Arne

[toc] | [prev] | [next] | [standalone]


#11698

FromChris Riesbeck <Chris.Riesbeck@gmail.com>
Date2012-02-01 13:49 -0600
Message-ID<9otjb6Fd2jU1@mid.individual.net>
In reply to#11690
On 1/31/2012 7:32 PM, Arne Vajhøj wrote:
> On 1/31/2012 2:03 PM, Chris Riesbeck wrote:
>> On 1/31/2012 12:57 PM, Chris Riesbeck wrote:
>>> On 1/31/2012 1:38 AM, Robert Klemme wrote:
>>>> On 31.01.2012 03:32, Arne Vajhøj wrote:
>>>>> On 1/30/2012 9:24 PM, Jim Lee wrote:
>>>>>> On Tue, 31 Jan 2012 02:21:11 +0000 (UTC), Martin Gregorie
>>>>>> <martin@address-in-sig.invalid> wrote:
>>>>>>> On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:
>>>>>>>> I have a Java server controller that read/write to Database table
>>>>>>>>
>>> Pretty much every response from the OP has suggested either really bad
>>> intra-team communication (distributed team?), or a system architect
>>> angling for an appearance on the Daily WTF.
>>
>> I change my mind. The same poster made the same query on comp.lang.php
>> but said
>>
>>> 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
>>
>> I now hypothesize trolling.
>
> It could be trolling.
>
> Or he just want both a Java and a PHP view on things.
>
> Out of curiosity: did the PHP folks answer similar to us?
>

The 1st responder asked "why not add a timestamp column?" and when the 
OP said "because of REST," another responder said that wasn't a reason. 
Other responses just tried to solve the problem. So similar but less 
push-back than over here.

[toc] | [prev] | [next] | [standalone]


#11702

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-02-01 19:23 -0500
Message-ID<4f29d76a$0$281$14726298@news.sunsite.dk>
In reply to#11698
On 2/1/2012 2:49 PM, Chris Riesbeck wrote:
> On 1/31/2012 7:32 PM, Arne Vajhøj wrote:
>> On 1/31/2012 2:03 PM, Chris Riesbeck wrote:
>>> On 1/31/2012 12:57 PM, Chris Riesbeck wrote:
>>>> On 1/31/2012 1:38 AM, Robert Klemme wrote:
>>>>> On 31.01.2012 03:32, Arne Vajhøj wrote:
>>>>>> On 1/30/2012 9:24 PM, Jim Lee wrote:
>>>>>>> On Tue, 31 Jan 2012 02:21:11 +0000 (UTC), Martin Gregorie
>>>>>>> <martin@address-in-sig.invalid> wrote:
>>>>>>>> On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:
>>>>>>>>> I have a Java server controller that read/write to Database table
>>>>>>>>>
>>>> Pretty much every response from the OP has suggested either really bad
>>>> intra-team communication (distributed team?), or a system architect
>>>> angling for an appearance on the Daily WTF.
>>>
>>> I change my mind. The same poster made the same query on comp.lang.php
>>> but said
>>>
>>>> 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
>>>
>>> I now hypothesize trolling.
>>
>> It could be trolling.
>>
>> Or he just want both a Java and a PHP view on things.
>>
>> Out of curiosity: did the PHP folks answer similar to us?
>>
>
> The 1st responder asked "why not add a timestamp column?" and when the
> OP said "because of REST," another responder said that wasn't a reason.
> Other responses just tried to solve the problem. So similar but less
> push-back than over here.

The PHP group probably have a larger fraction of "hobby programmers"
than the Java group.

Arne

[toc] | [prev] | [next] | [standalone]


#11689

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-01-31 20:31 -0500
Message-ID<4f2895f9$0$283$14726298@news.sunsite.dk>
In reply to#11678
On 1/31/2012 1:57 PM, Chris Riesbeck wrote:
> On 1/31/2012 1:38 AM, Robert Klemme wrote:
>> On 31.01.2012 03:32, Arne Vajhøj wrote:
>>> On 1/30/2012 9:24 PM, Jim Lee wrote:
>>>> On Tue, 31 Jan 2012 02:21:11 +0000 (UTC), Martin Gregorie
>>>> <martin@address-in-sig.invalid> wrote:
>>>>> On Mon, 30 Jan 2012 18:08:04 -0800, Jim Lee wrote:
>>>>>> I have a Java server controller that read/write to Database table
>>>>>>
>>>>>> Java 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
>>>>>>
>>>>> What problem are you using table rotation to solve?
>>>>>
>>>>> What would prevent you from using a single table containing
>>>>> datestamped
>>>>> rows which are archived and/or deleted the rows after "cycle length"
>>>>> days?
>>>>
>>>> my main problem is how to make sure "how to get the correct table name
>>>> to read/write to" depending what day in the week
>>>>
>>>> start a new DB table is a must since it's going through some other
>>>> REST backend layer
>>>
>>> There is nothing in REST that requires such a table structure.
>>>
>>> And it would be better to fix the bad code requiring such
>>> a table rollover than to make other apps bad to work with it.
>>
>> Another question: Jim, what database are you using? If the instance
>> requiring multiple tables is afraid of volume the typical solution to
>> this issue is called "partitioning". If your database supports it,
>> that's typically the way to go for such kind of data.
>
> Pretty much every response from the OP has suggested either really bad
> intra-team communication (distributed team?), or a system architect
> angling for an appearance on the Daily WTF.

In both cases it would make sense to push back a little
bit.

(within the constraints given by the org chart)

Arne

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web