trilbymedia / grav-plugin-flex-objects

Powerful and supremely flexible object support for Grav
MIT License
40 stars 10 forks source link

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

Open NicoHood opened 4 years ago

NicoHood commented 4 years ago

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

mahagr commented 4 years ago

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.