Stream: hapi
Topic: Permanent Delete
Andrew Broadbent (Aug 09 2017 at 10:29):
Is there any way to permanently delete a resource?
I have a special case where I want to upload several thousand resources as a single atomic operation. It's impractical to upload them all in a single bundle, so I've implemented a client side transaction which will delete all resources uploaded as part of the transaction (if necessary).
I upload resources in the order of references, e.g. group 1 has no references, group 2 has references to group 1, group 3 has references to group 2 or 1, etc. So I know I can delete them in reverse order without violating the referencing.
I'm aiming to permanently delete the resources because I don't want the server to keep track of what's happening in a transaction up until the final commit happens.
Any suggestions?
John Moehrke (Aug 09 2017 at 12:19):
sounds like you have an internal server implementation detail. Not a standards question.
Andrew Broadbent (Aug 09 2017 at 12:27):
@John Moehrke Quite possibly. Is there no standard way of permanently deleting resources?
If not, what is the standard way of dealing with things like this? For example I have a number of resources to upload, the number exceeds the physical memory limit for a single http post, so I have to upload them in smaller batches. One of the batches fails due to something like a syntax error. How do I recall all other resources that were part of that batch?
John Moehrke (Aug 09 2017 at 13:01):
You are describing the normal behavior of a service interface. Where a service interface would persist all or nothing in the transaction. This is not a REST concept, this is a Transaction concept. It is commonly defined as what is to happen if a Bundle of resources are posted. It is the defined behavior in the MHD profile that I have in IHE (XDS on FHIR). It is usually implemented by the service. Usually that service has direct access to the database, not using yet-another-layer.
That said, there is nothing wrong with a REST server that treats the DELETE operation as final. The delete operation is a request to delete. Some servers will be working in a policy that says that deletes are soft, other policy might define them as hard. There are also cases where the softness or hardness is based on the actor making the request. Normal user/service the delete is a version preserving deprecation; but if it is the Privacy-Officer or Medical-Records-Officer; then delete means permanent and non-reversible delete. Policy...
In your case the REST Delete could be context dependent. First it can tell the delete request is from the XYZ service, and second it can tell that the Delete has been executed within a few seconds of the Create.
But all of this is the implementation detail I mentioned. Delete is especially very Policy dependent, and very implementation architecture dependent.
Last updated: Apr 12 2022 at 19:14 UTC