Updating documents - immutability

Hi, I have a use case where a document can be updated or nested entries added to it over time. I get that documents are technically immutable and a new version is created, with the older one being soft deleted. Will this storage be restored in the background for new documents coming in, without manually intervening? If so, how often does this process happen? If it matters, I'm about the AWS managed Es.

Can you clarify this, it's not really clear what you mean.

Well I'm fairly new to elastic, and am doing some capacity planning/sizing. My question is along the lines of https://discuss.elastic.co/t/deleting-old-versions/4689. One of the answers there said

These 'deleted' docs will be automatically removed at some point in the
future when the "segments" in your index are merged. This happens in
the background, but can be manually triggered using the optimize API.

This is probably what I'm asking about. Say I update document 1. There is an older version now lingering in storage(soft deleted). When is this older version deleted and when is that space available to me again?

When a merge happens, which will depend on a few things. If you're updating somewhat regularly then the merges will occur regularly as well.

1 Like

Thanks, that helps!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.