Soft Deletes


I was reading this document regarding deletion of events in a stream.

I’m wondering which kind of deletion – hard or soft is done when I choose “Delete” on a stream in the UI?

Another thing: do I understand correctly that in order to truncate-before, I need to write $tb = X to stream metada, where X is event number until which it should be to truncated? If so, is it possible to write metadata via UI?

Thank you!

  • Karolis


I have found an answer to my question. According to every stream’s metadata is just another $$ prefixed stream, i.e. stream ZZ has it’s metadata in $$ZZ.

So all I need to do to write metadata from ES UI is to “Add Event” to this metadata stream.


  • Karolis

You can also just delete the stream providing you want all events gone if you want which does this for you… There is an operation for this both on the client API and on the http API.

Where you likely are more interested in using $tb directly is when you have say 11 events in a stream and want to remove the first 5.

There are two other pieces of metadata you likely want to be familiar with. $maxAge and $maxCount which represent limits on the stream automatically making things eligible for scavenging. As example I might have a sensor writing events and always want to keep the last 5 days worth of measurements or the last 500 measurements, but older are ok to be deleted. I can set $maxAge on this stream and it will happen automatically.