Do Not Delete Upstream

Somewhat new to couchbase, looking to do something I haven’t found in documentation yet.

We have a system that needs to clear local data every day. This is a non-negotiable business requirement.

However we need to keep the information of those deleted documents. I’m looking for a way to delete local documents without propagating that change upstream. How can this be done?

One idea we had was during a deletion we move the old to another channel, but that seemed to still mark the document as deleted. We do not want hundreds of thousands documents to be considered deleted in the cloud because we will use the cloud database for client functions. However as above, the data on the local machine must be deleted.

How can I accomplish this functionality?

The action you are interested in is called “purge”. However, be warned that this means those documents will still exist in the server and be pulled to any client that asks for them.

Purge will be hard to use, as we have peer-to-peer replication running on our tablets, but only one tablet is responsible for syncing upstream.

Purge would require us to use some kind of raft-consensus on top of the system we are running.

That information would have been very relevant in your first post. You will need to re-explain the situation accounting for the P2P tablets as well for us to give a meaningful response.

How about having each peer purge the doc once it’s pushed it to the gateway peer, and the gateway peer purges it once it’s pushed to the server?

Hey everyone thanks for the help, and I’ve actually found a solution.

I’m sorry for the poorly written question! Instead of taking this route, I’ve decided to leverage couchbase eventing service to archive docs before deletion.

New to the couchbase forums and world, thanks for the help!