You can identify the lag you have will be with the hard drive's I/O.
An alternative is to put the data in RAM. The procedure to do this is to keep the database on the hard disk and replicate that data to RAM. Although in your case, you might have the RAM version replicate to the hard disk. You'd do this at an interval of your desire. Using transactions would be a great idea too since during each replication of say 10 minutes, you'll have 10 minutes of fresh data you could lose in a power failure. So if you save the transactions to disk, you can rebuild and update the hard disk version from the last point your RAM one died.
Although this is all in theory. I believe you'll need an industrial database engine to make this work reliably.