There is a pet project with a web-text-editor (plaintext) and a desired feature to attach some resources (images, docs, etc.) by an id-link. The output - to avoid a software zoo - is a single binary (rust, only its stack).
I can't find a consistent text-and-associated-resources uploading algorithm, that has by-design, in priority order, the following:
- no broken links to a resource
- disk doesn't get messed when the resource link is deleted or the process of text with new link updating was roughly canceled
- minimal amount of disk writings, better if readings are also minimal
- text and resources count can be very large
As I imagine, the point about a mess requires an ability for some recovery cleaning as a part of server initialization. The thought about disk writing minimization is a hack to delete small resources not immediately in case the used changes his mind. All algorithm I could make myself is on the picture:
It looks complex, with many disk accesses, may have many underwater rocks, and the whole approach may be wrong.
So I need some help.

Aucun commentaire:
Enregistrer un commentaire