dao-xyz / peerbit

P2P database framework with encryption, sharding and search
https://peerbit.org
Apache License 2.0
196 stars 15 forks source link

Pinning documents and document deletions #279

Open threshold862543 opened 9 months ago

threshold862543 commented 9 months ago

When you delete something, it doesn't guarantee your peer won't receive it. Consider three peers, A, B, and C, who have different ACL. A posts a document D, and D is replicated by peers A and B. C deletes document D. This deletion operation is broadcast to and A and B, and in the ACL of A it is accepted, but in the ACL of B it is rejected. Later, C queries the database. Though A deleted the document, B will register the document as not being deleted, as the delete operation failed its ACL. Thus B includes document D in the query results given to C.

It would be nice if you could pin specific documents, as options both with put and del (eg. to ameliorate the above you don't necessarily pin every document you create, but you do pin documents you delete).

It's also possible to implement something similar by using another database of deletions, but having more granular control over a node's replication like this might be nice.