I don' know if this would be worth adding to the http interface or not but might it be useful to have a `soft delete` feature where the http interface returns a 410 (Gone) rather than a 404 (Not Found) status code after a document has been deleted. Perhaps as an audit trail or even a rollback feature.
A use case might be # currently boss PUT http://host.com/riak/important/someImportantDocumentA { ... } -> docA PUT http://host.com/riak/important/someImportantDocumentB { ... } -> docB intern DELETE http://host.com/riak/important/someImportantDocumentA // "Whoops! I think I might have deleted the wrong document! Hope the boss doesn't find out." boss GET http://host.com/riak/important/someImportantDocumentA // 404 "wtf!? Where did my TPS report go?" boss calls up intern --censored-- # a proposal boss PUT http://host.com/riak/important/someImportantDocumentA { ... } -> docA PUT http://host.com/riak/important/someImportantDocumentB { ... } -> docB intern DELETE http://host.com/riak/important/someImportantDocumentA (with new header x-riak-perm-delete=false) // "Whoops! I think I might have deleted the wrong document! Hope the boss doesn't find out" boss GET http://host.com/riak/important/someImportantDocumentA // 410 "silly intern, let's see what else he did" GET http://host.com/riak/important { "props": { ..., "deleted_keys":["someImportantDocumentA"] ] } } PUT http://host.com/riak/important/someImportantDocumentA (with new header x-riak-revive=true) GET http://host.com/riak/important/someImportantDocumentA // 200, "heh, glad I set my `important` bucket's `perm_delete` property to false" GET http://host.com/riak/important { "props": { ..., "deleted_keys":[], "perm_delete":false ] } } boss calls up intern and says not to worry and makes sure intern gets TSP report, mmm k. This is essentially a 2 new features. * a deletion audit trail with a bucket's deleted keys ( "deleted_keys":["foo","bar"] ) and 410 (gone) responses (of course this would probably be turned off by default) * per document rollback/revive feature that allows up to undo/undelete previously soft deleted documents What does everyone think? Would this be useful? -Doug Tangren http://lessis.me
_______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
