grav-plugin-flex-objects icon indicating copy to clipboard operation
grav-plugin-flex-objects copied to clipboard

Does this plugin handle concurrent file access - are the CRUD operations atomic?

Open NicoHood opened this issue 5 years ago • 1 comments

Hey there, I was recently wondering if the comments plugin is robust against parallel read/write operations (two people commenting at the same time). To me it seems it is not, and I am searching for a future proof way to handle this issue.

My first idea was to use the database plugin with sqlite, but then I stumbled across the flex objects plugin. Since it says it implements CRUD, does this mean all concurrent operations on the underlying file are handled by the plugin? If yes, that is great and should be added more explicit to the readme.

Cheers

NicoHood avatar Sep 29 '20 06:09 NicoHood

It really depends on the backend used for the storage. If you store comments on separate files (or create db backend) it'll be atomic. On a single file, it does lock the file, but not long enough to be atomic.

mahagr avatar Oct 07 '20 13:10 mahagr