Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Would you use SQLite?

by Corion (Pope)
on Feb 21, 2002 at 21:11 UTC ( #146807=note: print w/replies, xml ) Need Help??

in reply to Would you use SQLite?

I'm not sure whether I'd use SQlite, as I use databases mainly for two purposes :

  • Data storage - of course, with the amounts of my stored data, I could most likely keep the whole stuff in memory and wouldn't need a "real" database for it.
  • Process coordination/serialization - most "real" databases have internal protection against multiprocess issues, so I can offload the burden of maintaining a locked list to a database. I can easily set up producer/consumer relationships via a database table without having to worry about locking and stability; I can even upgrade a consumer or a producer on the fly without the other half noticing.

For the data storage part, the SQL syntax helps much here, as it makes searching easier to comprehend unless you want to do fancy (re/grep) searching. SQlite would help with the expandability/portability of the solution, as I could go from a flat file to a "real" database anytime.

I guess that, to use SQlite as a scheduler/coordinating entity, I would have to start a "SQlite SQL server" (you heard it first on, which opens sockets, and have some "special" DBD driver for my other processes to connect to the central server to cope with forked childs. This is not necessarily bad, as there is no other administration overhead with this SQL server, but on the other side, such a SQL server could be written independant of the underlying storage structure; it would be possible to have a server over DBD::CSV as well.

These are my raw thoughts, if I come up with more points, I'll add them to this node ...

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

Replies are listed 'Best First'.
Re: Re: Would you use SQLite?
by Matts (Deacon) on Feb 21, 2002 at 21:54 UTC
    Actually SQLite will handle concurrency issues for you (with a big ugly global lock ;-)

    So maybe that's one checkmark off for you.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://146807]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2017-03-29 01:44 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (343 votes). Check out past polls.