This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, Consider the attached model. From a business requirement, a blob cannot exist without a file, however several files can "share" the same blob. In a similar fashion a symmetric can be used by several blobs to encrypt its contents, however, a symmetric key requires at least one blob. So it essentially means that when the last file is deleted the blob should be deleted too, and when the last blob of a symmetric key is deleted, the the symmetric key should be deleted too. A problem arises when a user, workspace, folder or file is deleted. LightSpeed will cascade the delete and I'm left with an orphan blob. To work around that, the following has been done.
Both of these result in unnecessary queries being executed and wastes precious database resources. Is there a more appropriate manner to handle the deletions of orphan blobs or symmetric keys in LightSpeed? Thanks, Werner |
|
|
Some days I think we're writing the same app, Werner. My blobs are outside the database so I solved it with refcounting via triggers. A separate scheduled task cleans as necessary. You could build the delete logic into the database if everything is in there. Another option is to denormalize and duplicate everything per blob in one table. That's what a certain site that rhymes with floprocks does. |
|