You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your improvement related to a problem? Please describe.
Currently, outbox transport operations (MessageId, Operations columns), saga data (Datacolumn) and saga string correlation (Correlation_% column) use the nvarchar type.
This requires twice as much storage for most data stored in these columns as SQL Server its nvarchar type uses 16 bit characters.
Supporting varchar UTF8 collation would half the required storage.
Clone SqlDialect.cs to Sql2019Dialect.cs and make it inherit from SqlDialect:
Change column definition to UTF8 in the script builder to use an explicit collation that supports UTF8:
From: Operations nvarchar(max) not null
To: Operations varchar(max) COLLATE Latin1_General_100_CI_AI_SC_UTF8 not null
Describe alternatives you've considered
An alternative is to not use nvarchar but varbinary and convert to utf8 byte structure in the persisted which would also be compatible with older versions of SQL Server.
The text was updated successfully, but these errors were encountered:
ramonsmits
changed the title
Add a SQL2019 dialect that supports storing text as Utf8
SQL Server: Add a SQL2019 dialect that supports storing text as Utf8
May 31, 2024
Describe the suggested improvement
Is your improvement related to a problem? Please describe.
Currently, outbox transport operations (
MessageId
,Operations
columns), saga data (Data
column) and saga string correlation (Correlation_%
column) use thenvarchar
type.This requires twice as much storage for most data stored in these columns as SQL Server its
nvarchar
type uses 16 bit characters.Supporting varchar UTF8 collation would half the required storage.
Describe the suggested solution
SQL Server 2019 now supports UTF8:
Likely the easiest approach is to:
Sql2019Dialect.cs
and make it inherit fromSqlDialect
:Operations nvarchar(max) not null
Operations varchar(max) COLLATE Latin1_General_100_CI_AI_SC_UTF8 not null
Describe alternatives you've considered
An alternative is to not use
nvarchar
butvarbinary
and convert to utf8 byte structure in the persisted which would also be compatible with older versions of SQL Server.The text was updated successfully, but these errors were encountered: