Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-19 Thread Dennis Cote
Allen Fowler wrote: > I have several CGI and cron scripts and that I would like coordinate via a > "First In > / First Out" style buffer.That is, some processes are adding work > units, and some take the oldest and start work on them. > > Could SQLite be used for this? > > It would seem very

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-19 Thread Christopher Taylor
-- From: "Douglas E. Fajardo" Sent: Tuesday, May 19, 2009 11:57 AM To: "'General Discussion of SQLite Database'" Subject: Re: [sqlite] Sqlite as a FIFO buffer? > One-per-second sounds *very* slow - I think I was g

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-19 Thread Douglas E. Fajardo
tasks. *** Doug F. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Christopher Taylor Sent: Monday, May 18, 2009 9:36 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Sqlite as a FIFO buffer

Re: [sqlite] Sqlite as a FIFO buffer? (How make atomic?)

2009-05-18 Thread Kees Nuyt
On Mon, 18 May 2009 12:17:25 -0700 (PDT), Allen Fowler wrote: > >> >I have several CGI and cron scripts and that I would like coordinate via a > >> "First In >> >/ First Out" style buffer.That is, some processes are adding work >> >units, and some take the oldest and start work on them. >> >

Re: [sqlite] Sqlite as a FIFO buffer? (How make atomic?)

2009-05-18 Thread Allen Fowler
> >I have several CGI and cron scripts and that I would like coordinate via a > "First In > >/ First Out" style buffer.That is, some processes are adding work > >units, and some take the oldest and start work on them. > > > >Could SQLite be used for this? > > > > For what it's worth, here

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Kees Nuyt
On Sun, 17 May 2009 21:34:58 -0700 (PDT), Allen Fowler wrote: > >Hello, > >I have several CGI and cron scripts and that I would like coordinate via a >"First In >/ First Out" style buffer.That is, some processes are adding work >units, and some take the oldest and start work on them. > >Cou

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Allen Fowler
> One thing to watch out for - using SQLITE for a FIFO will have limited > throughput, because commits will have to be done after inserting or removing > each entry. This is fine for now. Wiling to migrate to MySQL, etc if needed for speed. > This might not be an issue in some situations

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Christopher Taylor
-- From: "Douglas E. Fajardo" Sent: Monday, May 18, 2009 12:25 PM To: "General Discussion of SQLite Database" ; "AllenFowler" Subject: Re: [sqlite] Sqlite as a FIFO buffer? > One thing to watch out for - using SQ

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Douglas E. Fajardo
AM To: Allen Fowler; General Discussion of SQLite Database Subject: Re: [sqlite] Sqlite as a FIFO buffer? The way this table works is that when an insert is made, the trigger is activated. The trigger looks to see if there are more than a set number of records. If so, the oldest record(s) are

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Christopher Taylor
The way this table works is that when an insert is made, the trigger is activated. The trigger looks to see if there are more than a set number of records. If so, the oldest record(s) are deleted by the trigger. This is accomplished using an auto increment field. This number increases by one

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Allen Fowler
ct stored procedures / triggers to make this work? (Or, is this even the correct approach?) Thank you, :) > > > - Original Message > > From: Christopher Taylor > > To: General Discussion of SQLite Database > > Sent: Monday, May 18, 2009 11:42:16 AM > &

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Allen Fowler
rocedures / triggers to make this work? (Or, is this even the correct approach?) Thank you, :) - Original Message > From: Christopher Taylor > To: General Discussion of SQLite Database > Sent: Monday, May 18, 2009 11:42:16 AM > Subject: Re: [sqlite] Sqlite as a FIFO

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread John Machin
On 19/05/2009 1:42 AM, Christopher Taylor wrote: > I took a slightly different approach and used a trigger. This is the create > table function from my event log class. The string handler is proprietary > but other than that there should be enough there to give you an idea. > > void DbEventLog::

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Christopher Taylor
I took a slightly different approach and used a trigger. This is the create table function from my event log class. The string handler is proprietary but other than that there should be enough there to give you an idea. void DbEventLog::CreateTable(sqlite3* pDatabase) { // create the table an

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread Allen Fowler
> > I have several CGI and cron scripts and that I would like coordinate via a > "First In > > / First Out" style buffer.That is, some processes are adding work > > units, and some take the oldest and start work on them. > > > > Could SQLite be used for this? > > > > It would seem very co

Re: [sqlite] Sqlite as a FIFO buffer?

2009-05-18 Thread John Stanton
You should be able to implement a classic circular buffer in SQL and make it a VIEW for easy access. ROWIDs can be the buffer pointers and a second table can store the current values. Allen Fowler wrote: > Hello, > > I have several CGI and cron scripts and that I would like coordinate via a >

[sqlite] Sqlite as a FIFO buffer?

2009-05-17 Thread Allen Fowler
Hello, I have several CGI and cron scripts and that I would like coordinate via a "First In / First Out" style buffer.That is, some processes are adding work units, and some take the oldest and start work on them. Could SQLite be used for this? It would seem very complex to use SQL for j