jeudi 2 septembre 2021

What are the optimal algorithms for associated files uploading? [closed]

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:

  1. no broken links to a resource
  2. disk doesn't get messed when the resource link is deleted or the process of text with new link updating was roughly canceled
  3. minimal amount of disk writings, better if readings are also minimal
  4. 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:

enter image description here

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