-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GZip compression for WorkflowInstance Data field on EF Core #4876
Conversation
This update adds a compression feature for workflow state data to reduce storage needs. A compression strategy resolver, None and GZip strategies have been implemented. Migration scripts were also updated, and a superfluous file(s) were removed.
This commit includes the creation of migration files for MySql, SqlServer, Sqlite, and PostgreSql contexts in the Elsa project. The files for version V3_1 were automatically generated and are to be implemented with the necessary changes in the Up and Down methods as per the requirements.
This commit introduces two new fields to the WorkflowInstances table: "DataCompressionAlgorithm" and "DataFormat". These changes allow storing additional contextual information about the payloads of workflow instances and enhance future handling and processing of this data.
I want to apply this also to the ActivityState field of the ActivityExecutionRecord table - for some customers, these fields can reach many megabytes (10MB for some scenarios that I noticed). |
Deleted all migration files related to the Management module across MySql, SqlServer, Sqlite and PostgreSql data providers. These files included data compression algorithm and data format column additions in the WorkflowInstances table.
src/modules/Elsa.EntityFrameworkCore/Modules/Runtime/ActivityExecutionLogStore.cs
Outdated
Show resolved
Hide resolved
RavenDB folks did come compression algorithm comparison recently against JSON data (zstd was a clear winner): ravendb/ravendb#17678 |
Removed ICompressionStrategyResolver interface and file, and added ICompressionCodec and ICompressionCodecResolver interface. Updated relevant classes for the new interface. Specifically, added Zstd class under Compression as a new compression method. Also modified WorkflowInstanceStore.cs, None.cs, EFCoreWorkflowInstanceStore.cs, GZip.cs, and ActivityExecutionLogStore.cs for uniform compression terminology.
Wow, ZSTD is not only significantly faster, but produces smaller output as well. |
This PR adds the ability to store workflow state in a compressed format for EF Core.
Future updates may include other persistence provider support such as Dapper and MongoDB.
Closes #4875