3 ms·
>> but it’s a lot more work than just a rename Such as?
by andrewstuart 3y ago
>> but it’s a lot more work than just a rename
Such as?
- ruuda 3y agoDetecting broken files when your application crashed half-way through a write; coordinating id generation.
- doctor_eval 3y agoWell, if you have multiple writers then you need to decide who’s responsible for rotating the queues, and you need to serialise writes; or if each writer has its own queue then the reader has to do more work. And then you need to worry about fsync, and backup. And of course you need to be careful to flush to the queue after each write to avoid partial writes. Basically I’m saying that there are just a number of potential footguns when using files as queues - I speak from experience! - which are trivially taken care of by a database, especially if you have one already. I’m not saying that it’s not possible, just that for non trivial applications, it’s certainly more complex than just an atomic file move.