node-persist icon indicating copy to clipboard operation
node-persist copied to clipboard

Does it lock?

Open salarelv opened this issue 7 years ago • 2 comments

If I call setItem does it lock the given key for reading? I have application where one process writes data into the database and another reads and removes when it has processed the data.

salarelv avatar May 20 '17 20:05 salarelv

nope, whichever comes first. the thing is it won't need to lock, it writes into RAM first, then persists to disk, maybe later, maybe soon after, so whatever is reading it, it's reading from RAM - think of it as a light version of redis db

akhoury avatar May 21 '17 21:05 akhoury

RAM comment is no longer valid as of 3.0, we're no longer storing data in RAM, it all depends on the OS's disk I/O transactions

akhoury avatar Apr 11 '18 14:04 akhoury