basic question about sqlite

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

basic question about sqlite

Dave Dyer

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 ?

Reply | Threaded
Open this post in threaded view
|

Re: basic question about sqlite

Dan Kennedy

> 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
Reply | Threaded
Open this post in threaded view
|

Re: basic question about sqlite

John Stanton-3
In reply to this post by Dave Dyer
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 ?
>

Reply | Threaded
Open this post in threaded view
|

Re: basic question about sqlite

Clay Dowling
In reply to this post by Dave Dyer

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

Reply | Threaded
Open this post in threaded view
|

Re: basic question about sqlite

Edward Wilson
What is the best approach to concurrency in this scenario?

--- Clay Dowling <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: basic question about sqlite

Clay Dowling

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