> On 8. Apr 2021, at 19:53, Olaf Krueger <[email protected]> wrote:
>
>
>> Also, I don’t quite get what “re-creating” a database would entail.
>
> Sorry, it seems to me that doesn't makes sense.
> While I wrote this I had the docs in my mind [1]:
>
>> If your use case creates lots of deleted documents (for example, if you are
>> storing short-term data like >log entries, message queues, etc), you might
>> want to periodically switch to a new database and >delete the old one (once
>> the entries in it have all expired).
>
> But re-reading this it turns out to me that this only makes sense if we don't
> need to keep the remaining docs.
>
>> 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.
>
> Just out of curiosity:
> Would be the purge feature [2] a way out here?
Yes, but it comes with other caveats. It is best used for “I accidentally
committed a credit card number to CouchDB, let’s undo that” and less “clean up
1000s of old records every day” type of operations.
It’ll work in a pinch, but if you are starting out, db-per-time allows you to
avoid getting into a tight spot to begin with :)
Best
Jan
—
>
> Thanks,
> Olaf
>
>
> [1]
> https://docs.couchdb.org/en/stable/maintenance/performance.html#delete-operation
> [2] https://docs.couchdb.org/en/latest/api/database/misc.html?highlight=purge