On March 28, Simone P. Lossani wrote:
Hello,
I'm doing some test with SQlite 3.7.11 in Windows Embedded industrial PC.
I need to store data in a table very quickly. Let's say new data each 10 msec.
I tryed with DB on disk but obviously was not possible to reach the correct
performance.
So I tryed with in-memory DB and in this case the performance results are good.
The problem is that I can't share the in-memory database with other
applications.
I red a lot of article and documentation but I have not solved the problem.
Maybe with temporary DB I can have the same performance and also I can share DB?
Have you some suggestion?
There are a couple approaches that meet the constraints stated so far.
It would help, when trying to find a viable approach, to know what
characteristics the solution must have. Does it have to be robust
against database corruption due to power loss? On what schedule does
the database sharing occur? What delay is acceptable between when data
is put into the fast database and when it is available in the shared
database?
I would look at using the Windows memory-mapped file API. This would be
exposed to SQLite using its virtual filesystem mechanism.
An alternative is to keep two databases in sync. One would be the
in-memory database. The other would be the one you share, kept in an
ordinary file. They would be kept in sync by one of several means:
Triggers on table inserts or updates to replicate the data; parallel
updates or inserts at the prepare/execute level; or periodic
whole-database copying.
If there can be some delay between when data is to be stored and when it
is available to consumers, you might just do the database modifications
in a separate thread. (I am suggesting that "I need to store data in a
table very quickly." might mean only "I need the thread which accepts
the data for storage to be quickly available for other work.")
Regards,
--
Larry Brasfield
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users