EventStore / EventStore-Client-Dotnet

Dotnet Client SDK for the Event Store gRPC Client API written in C#
Other
143 stars 37 forks source link

Rename CheckpointInterval to CheckpointIntervalMultiplier #69

Closed shaan1337 closed 5 months ago

shaan1337 commented 4 years ago

This is a breaking change and needs to be done in the next major version:

https://github.com/EventStore/EventStore-Client-Dotnet/blob/master/src/EventStore.Client.Streams/SubscriptionFilterOptions.cs#L19

https://github.com/EventStore/EventStore-Client-Dotnet/blob/master/src/EventStore.Client.Streams/SubscriptionFilterOptions.cs#L37

The checkpoint interval is actually multiplied by the max search window to determine the number of events after which to checkpoint.

ahjohannessen commented 4 years ago

Why is it necessary to have a checkpoint interval multiplier? if MaxSearchWindow=32 and CheckPointIntervalMultiplier=6, then why not just MaxSearchWindow=192 - Am I missing something obvious?

hayley-jean commented 2 years ago

Hi @ahjohannessen The main reason for having the interval and the window separate is so that the number of events being read at a time on the server can be better controlled. By default, the CheckpointInterval is set to 1, so your subscription will checkpoint every time it has considered MaxSearchWindow count of events.

However, you may want to checkpoint much further apart, say every 1000 events, but would rather keep the read batches small to lower load on the system. In that case, you could set the MaxSearchWindow to 50 and the CheckpointInterval to 20.

ahjohannessen commented 2 years ago

@hayley-jean All good. Just thought it is convoluted from a client lib perspective, but I get your point 👍