JasperFx / wolverine

Supercharged .NET server side development!
https://wolverinefx.net
MIT License
1.27k stars 139 forks source link

For Marten backed sagas that are soft-deleted, load by id & is_deleted = false #1052

Open jeremydmiller opened 1 month ago

jeremydmiller commented 1 month ago

Little performance optimization.

come back and continue the blog series on long running workflows with this text:

"

Next, let's worry just a little bit about performance as an excuse for me to show off some more Marten functionality. Let's say that we're getting a ton of these files on a daily basis, so our database storage for FileImportSaga could be getting quite large and eventually impact database performance. But we still want to keep a database record of all the files that we read into our system, so what to do?

An experienced developer is probably going to ask about some kind of archival process where completed files are moved off into "cold" storage while active files stay in a much smaller "hot" storage to keep the database responsive over time. And you know what, Marten has some tools for exactly this kind of thing completely baked in!

Remember as part of the FileImportSaga state machine we had this code that might mark the current saga as "completed" depending on

"

jeremydmiller commented 1 month ago

This is going to take a Marten change to have a LoadIfNotSoftDeleted or some such