Skip to content

Conversation

@TechnoDezi
Copy link

@TechnoDezi TechnoDezi commented Feb 27, 2025

On the v2 workflows when creating and running large multi-step workflows the data stored on ms sql in json format gets very large.

This change adds compression on the serialized json to reduce the data stored and decompresses it again during loading and serialization.


This change is Reviewable

…tence. This will dramatically reduce the size of the data stored on the database
@TechnoDezi
Copy link
Author

TechnoDezi commented Feb 27, 2025 via email

@sfmskywalker
Copy link
Member

@TechnoDezi This improvement makes sense, but it would be better if compression could be enabled or disabled. In V3, we implemented this feature as follows:

  1. In Program.cs, we configure an option to specify the compression codec, defaulting to None.
  2. The WorkflowInstance class includes an additional column to store the compression codec used. When decompressing, this stored codec is used, ensuring consistency even if the current codec configuration has changed. This allows for codec switching or disabling without issues.

You might consider a similar approach, where instead of embedding the compression logic directly in the store class, it resides in a strategy class. This way, you could define a default strategy that performs no compression and another that applies the compression method from this PR. The name of the strategy used during compression would then be stored alongside the record in a separate column, ensuring the correct strategy is applied during decompression.

Copy link
Member

@sfmskywalker sfmskywalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great to have the option to compress the data column contents, but this should be configurable: the default should be no compression. Ideally, the selected compression code should be configurable from Startup/Program, just like Elsa 3.

@FransVanEk
Copy link
Contributor

this will also compromise the latest changes where this column is actually being use for querying the structure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants