Hi John,

>I wouldn't use SQLite for most in memory data that never needs to be
>stored on disk

Even this depends entirely on your context.  Of course if only a simple 
lookup in a table is more or less all you ever need, there is little 
point in SQLite.  But if or when your requirements get more complex and 
things shift away from what basic data structures can do, SQLite can be 
something worst considering.

For instance, if the language you use doesn't offer native support for 
flexible data structure and fancy access to such data, you can feel 
much more comfortable using memory DB(s) than a collection of 
third-party libraries, not always consistent between each other, to 
achieve the same effect as SQLite can offer in minutes.

I use AutoIt (a very complete Basic-like scripting language for 
Windows) to develop most applications I need.  It doesn't offer 
structures, nor unions, nor objects nor, say, associative arrays.  But 
it only takes a dozen lines of code to have associative arrays 
available using an SQLite memory database, with more flexibility in 
usage than most AA implementations rigidly built into many fashionable 
languages.

For instance I use memory DBs to store all the (volatile obviously) 
settings and readings of a series of Lan-enabled (NI Visa) GPIB 
measurement instruments and I can perform sophisticated calibration 
sequences accross several of them with only a handful of SQLite 
statements, using the available AutoIt Visa support.  Doing the same 
with native variants and arrays of AutoIt and proprietary structures 
and code would be very difficult and error-prone: hundreds of 
parameters and a fairly large set of constraints between them.  Doing 
the same --even in C[++]-- without SQLite would turn this into a _much_ 
bigger development.

OTOH I also use the same setup to develop applications for my wife's 
business back office and there again I've finaly found SQLite memory 
DBs extremely simple to use and powerful.

In the two cases, I don't care how much memory is needed for data, nor 
which size the executable and shared libraries sum up to, nor the 
overhead these layers have: all this is faster than human brain, so I 
consider myself lucky.

The picture obviously blurs in situations where resources and cycles 
are less abundant.  SQLtiny for MicroChip controllers: anyone? ;-))



_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to