> On 8. Apr 2021, at 13:56, Olaf Krueger <[email protected]> wrote:
>
> Hi,
>
>> ... I will be required to be able to delete all data for a departing
>> customer....
>
> Wouldn't it be a valid option to remove all documents which are related to a
> particular customer from a single database and (if needed) re-create the
> database afterwards in order to get rid of the revisions or "tombstones”?
Deleting a doc creates a tombstone, that’s where just deleting the user db is
easier, you don’t want to collect too many tombstones.
Also, I don’t quite get what “re-creating” a database would entail.
> Using meaningful _ids instead of anonymous uuids could be helpful here, e.g.
>
> customer:1
> customer:1.address
> customer.1.meeting.1.scheduling
> customer.1.meeting.1.result
> customer.1.meeting.2.result
>
> customer:2
> customer:2.address
> customer.2.meeting.1.scheduling
> customer.2.meeting.1.result
> customer.2.meeting.2.result
>
> By using the leading string of the _id, e.g. "customer:1", you could fetch or
> delete all relations for a particular customer.
> Moreover, with the knowledge of the customer-id and meeting-id, you can
> easily compose the _id of each document in order to directly fetch it by its
> _id.
Good example, that’s what I meant with:
> - you can get all data per user in one request
> - either via _all_docs if your doc _ids are prefixed with the user id
Best
Jan