RE: [sqlite] basic question about sqlite
Has somebody got amnesia or something? I think I've seen this question going on four or five times now. > -Original Message- > From: Dave Dyer [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 03, 2005 12:40 PM > To: sqlite-users@sqlite.org > Subject: [sqlite] basic question about sqlite > > > > If I designed a sqlite database to be used by a bunch of independent > applications, for example a group of CGI scripts each of which > opened the database, did some processing, and exited, would > that be (a) safe (b) effecient ? >
Re: [sqlite] basic question about sqlite
Edward Wilson said: > What is the best approach to concurrency in this scenario? > Don't choke when you get a SQLITE_BUSY error. Just wait and try again in a second or so. Clay Dowling -- Simple Content Management http://www.ceamus.com
Re: [sqlite] basic question about sqlite
What is the best approach to concurrency in this scenario? --- Clay Dowling <[EMAIL PROTECTED]> wrote: > > Dave Dyer said: > > > > If I designed a sqlite database to be used by a bunch of independent > > applications, for example a bunch of CGI scripts each of which > > opened the database, did some processing, and exited, would > > that be (a) safe (b) effecient ? > > It's very safe. My own product does that (see the tag line). In many > ways it's more efficient than using a database server, since opening a > file is usually faster than opening a network connection to a database > server. > > Clay > -- > Simple Content Management > http://www.ceamus.com > > __ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs
Re: [sqlite] basic question about sqlite
Dave Dyer said: > > If I designed a sqlite database to be used by a bunch of independent > applications, for example a bunch of CGI scripts each of which > opened the database, did some processing, and exited, would > that be (a) safe (b) effecient ? It's very safe. My own product does that (see the tag line). In many ways it's more efficient than using a database server, since opening a file is usually faster than opening a network connection to a database server. Clay -- Simple Content Management http://www.ceamus.com
Re: [sqlite] basic question about sqlite
Yes to both questions. Just make sure that your application can handle the situation of occasionally finding the database locked momentarily. In our tests on an old 200MHz server such a CGI process executes in 10mS or less and would permit maybe as many as 200 simultaneous users. JS Dave Dyer wrote: If I designed a sqlite database to be used by a bunch of independent applications, for example a bunch of CGI scripts each of which opened the database, did some processing, and exited, would that be (a) safe (b) effecient ?
Re: [sqlite] basic question about sqlite
> If I designed a sqlite database to be used by a bunch of independent > applications, for example a bunch of CGI scripts each of which > opened the database, did some processing, and exited, would > that be (a) safe (b) effecient ? I think lots of people have used that pattern successfully. __ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com
Re: [sqlite] basic question about sqlite
It would be safe and efficient provided that you did not have a massive load with many processes expecting simultaneous access. Just be careful that your applications can gracefully handle the occasional lock state and use transactions carefully. Don't design in queries which have a long execution time. It is called "..lite" for a good reason. JS Dave Dyer wrote: If I designed a sqlite database to be used by a bunch of independent applications, for example a bunch of CGI scripts each of which opened the database, did some processing, and exited, would that be (a) safe (b) effecient ?
Re: [sqlite] basic question about sqlite
On 10/28/05, Dave Dyer <[EMAIL PROTECTED]> wrote: > > If I designed a sqlite database to be used by a bunch of independent > applications, for example a bunch of CGI scripts each of which > opened the database, did some processing, and exited, would > that be (a) safe (b) effecient ? As long as you check the return codes, which might indicate if you have conflicts, it should work just fine. That's exactly what I did with it. It works fine and is quite speedy. You might consider fast cgi if your web server supports it.