Yes - snapshots are incremental, so this is fairly cheap.
It depends how you fetch the status of your process. If you fetch it through the Operate API (or the new, soon to be released Camunda REST API), then the latest state is fetched from your history storage. This is either Elasticsearch, or OpenSearch.
When something is replicated to enough followers, it is processed (as you pointed out), but it’s also exported to your history storage, making it available for a longer (configurable) retention period.
Not immediately, but sort of: when an entry on the log has been processed and exported, it can be deleted. There’s some logic around it tied to snapshots and segment size, but that’s implementation details. Just assume once it’s been processed and exported, it’s quite likely deleted.
Thanks @Kaveri_Govindasamy . Okay. So always my above mentioned APIs are fetched from snapshots ?
In this case, I have a scenario where my workflow instance will take 3 months to get completed. So the whole 3 months my event data is present in the Snapshots or Event logs ?
And also I have a doubt the snapshots will created for each request sending from zeebeclient ?
Yes, data is removed from the history storage (e.g. ES) only if the associated process instance is completed, and it was completed at least 30 days ago (30 days being the default retention, but that’s configurable).
Above mentioned api will fetch from ES or Snapshot or Event Log
I have 2 workflow, first one will take 20 days to complete, so when I am querying on 20th date, the above query records will fetch it from the ES or Snapshot or Event Log
second workflow will take 60 days to get complete, so when I am querying on 50th date, the above query records will fetch it from the ES or Snapshot or Event Log
Is snapshot created for the each request sending from the zeebe client ?
Both APIs will fetch data from ES, and all read calls will always fetch from ES.
It will be fetched from ES. Also, the data can be retained depending on the historical data archival policy from the date of process completion. These are the defaults and can be configured:
Operate: 30 days
Optimize: 180 days
Tasklist: 30 days
Zeebe: 7 days
Same as answer #2.
No, a snapshot is created when any of the following conditions are met: every 5 minutes, event log exceeds 5MB size of data, or 5K event records. However, every event is written to the in-memory state and replicated to multiple brokers before it is committed.
For more details please refer the below reference.