liquidprojections / LiquidProjections

Liquid Projections supports building and maintaining autonomous .NET projection code in an Event Sourcing architecture.
https://www.liquidprojections.net
MIT License
169 stars 25 forks source link

Don't update the checkpoint number if nothing was changed #110

Closed dennisdoomen closed 6 years ago

dennisdoomen commented 6 years ago

Suggested by @CoenRutgers

The following performance improvements has been identified in the a-sync dispatcher process that could benefit the performance. The a-sync dispatchers will be phased out but the performance improvements are also applicable for the dispatching of events for Liquid projections

Performance improvements Don't update the checkpoint number for every commit / transaction if there were no changes applied by the projection. But update the checkpoint number every minute.

Note If a commit / transaction applies changes to the projection, then the checkpoint number should be updated directly

maxcherednik commented 6 years ago

I guess we must update the checkpoint no matter what. Especially it should be updated along with the actual data within the same transaction. Otherwise there is a chance of applying same events several times. Right?

Apart from that, real case from prod - 250k events which one of the projections is not interested in. If we don't update the checkpoint, there is a chance reading them again and again.

p.s. Single update by key per batch is nothing. Not worth optimizing.

IharBury commented 6 years ago

Should be a good improvement indeed. However for Liquid Projections this will require deep integration into the event maps. The interfaces will change.

dennisdoomen commented 6 years ago

Resolved in 3.0.0