This is a question to ask about a particular Sqlite configuration to see if it 
is appropriate or how to make it better.

A brief sketch of the processing need is that I have one process managing a lot 
of "item" data in a Sqlite db, and occasionally there is a need to walk through 
all items and read some stuff from the db, do some substantial processing, and 
write back some new results.  Each item can be processed independently.  There 
is no other competition for accessing the database while this is going on.

I have the following Sqlite 3.7.14.1 configuration that seems to work well, but 
it is likely not common so I would like some validation or alternatives.

 - one process that  uses many threads to do the work
 - WAL journal mode on local Sqlite db
 - SQLITE_THREADSAFE=2   SQLITE_TEMP_STORE=2
 - one read-write connection
 - 5 read-only connections
 - all 6 connections use one large shared cache
 - all connections are configured with read-uncommitted
 - processing is done in N threads with each processing one item at a time, and 
when needed each thread briefly acquires (with thread synchronization) one of 
the read connections or the write connection to read or write from the db and 
then immediately releases it for another thread to use
 - when all work is done then one thread will commit the write connection

This is essentially having 6 connections all participate in a single very large 
Sqlite transaction.  And, it seems to work well.

But, is this a valid and safe usage of Sqlite?  Are there alternatives or other 
configuration settings that would help?

Thanks!
Bob
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to