Akka.Persistence.Sql v1.5.24
1.5.24 June 13th 2024
- Bump AkkaVersion to 1.5.24
- Bump Akka.Hosting version to 1.5.24
- Fix missing Query configuration value override for non-default journal ids
- Bump System.Reactive.Linq version to 6.0.1
1.5.20 May 8th 2024
- Fix missing take and optimize captures
- Bump Linq2Db to 5.4.1
- Bump AkkaVersion to 1.5.20
- Bump Akka.Hosting version to 1.5.20
- Bump FluentMigrator version to 5.2.0
- Bump LanguageExt.Core version to 4.4.8
1.5.14-alpha April 19 2024
1.5.13 September 28 2023
- Update Akka.NET to 1.5.13
- Fix missing Persistence.Query configuration in legacy HOCON configuration mode
- Bump Akka.Hosting version to 1.5.12.1
- Bump Language.Ext.Core version to 4.4.4
- Bump System.Reactive.Linq version to 6.0.0
- Bump linq2db version to 5.2.2
1.5.12 August 8 2023
Akka.Persistence.Sql is now out of beta and ready for general use.
1.5.12-beta1 August 4 2023
1.5.9-beta1 July 20 2023
- Update Akka.NET to 1.5.9
- Bump Akka.Hosting to 1.5.8.1
- Persistence.Query: Fix invalid generated HOCON config
1.5.4-beta1 April 25 2023
Added transaction for every SQL queries with adjustable isolation level for read and write operations. You can go to the official Microsoft documentation to read more about these transaction isolation level settings.
Four new HOCON settings are introduced:
akka.persistence.journal.sql.read-isolation-level
akka.persistence.journal.sql.write-isolation-level
akka.persistence.snapshot-store.sql.read-isolation-level
akka.persistence.snapshot-store.sql.write-isolation-level
In Akka.Persistence.Sql.Hosting, These settings can be set programmatically through these new properties:
SqlJournalOptions.ReadIsolationLevel
SqlJournalOptions.WriteIsolationLevel
SqlSnapshotOptions.ReadIsolationLevel
SqlSnapshotOptions.WriteIsolationLevel
NOTE
Currently, there is a bug with Linq2Db and MySql implementation that can cause the SQL generator to throw an exception if you use the default
IsolationLevel.Unspecified
setting. Please useIsolationLevel.ReadCommitted
if this happens to you.
1.5.2-beta3 April 19 2023
NOTE: Database schema changes
1.5.2-beta2 package should be considered as deprecated. If you experimented with 1.5.2-beta1 and/or 1.5.2-beta2, you will need to drop existing persistence tables and recreate them using 1.5.2-beta3
- Fix SQL scripts for database table constraint and indices
- Add official MySql support
- Optimize sequence number and tag query
- Optimize tag query by avoiding multiple DB queries
- Add missing migration support to hosting extension method
This beta version introduces database schema optimization to:
- Improve the tag table based query performance even more.
- Improve inter-compatibility with other SQL persistence plugins.
Tag Query Benchmark
Benchmark is performed on a worst possible scenario:
- Event journal table with 3 million row entries
- Tagged events near the end of the table
- Numbers are measured as the time required to complete one operation (complete retrieval of N tagged events).
Tag Count | TagMode | Mean | Error | StdDev |
---|---|---|---|---|
10 | Csv | 1,760.393 ms | 27.1970 ms | 25.4401 ms |
100 | Csv | 1,766.355 ms | 25.0182 ms | 23.4021 ms |
1000 | Csv | 1,755.960 ms | 33.8171 ms | 34.7276 ms |
10000 | Csv | 1,905.026 ms | 22.3564 ms | 20.9122 ms |
10 | TagTable | 2.336 ms | 0.0389 ms | 0.0344 ms |
100 | TagTable | 3.943 ms | 0.0705 ms | 0.0660 ms |
1000 | TagTable | 18.597 ms | 0.3570 ms | 0.3506 ms |
10000 | TagTable | 184.446 ms | 3.3447 ms | 2.9650 ms |
1.5.2-beta2 April 14 2023
NOTE: Database schema changes
1.5.2-beta1 package should be considered as deprecated. If you experimented with 1.5.2-beta1, you will need to drop existing persistence tables and recreate them using 1.5.2-beta2
- Fix event journal table and tag table constraints and indices
- Fix snapshot table constraints and indices
This beta version introduces database schema optimization to:
- Improve the tag table based query performance, without compromising overall persistence performance.
- Improve inter-compatibility with other SQL persistence plugins.
Tag Query Benchmark
Benchmark is performed on a worst possible scenario:
- Event journal table with 3 million row entries
- Tagged events near the end of the table
Tag Count | TagMode | Mean | Error | StdDev |
---|---|---|---|---|
10 | Csv | 1,746.621 ms | 27.8946 ms | 29.8469 ms |
100 | Csv | 1,724.465 ms | 25.4638 ms | 23.8189 ms |
1000 | Csv | 1,723.063 ms | 26.2311 ms | 24.5366 ms |
10000 | Csv | 1,873.467 ms | 26.1173 ms | 23.1523 ms |
10 | TagTable | 3.201 ms | 0.0633 ms | 0.1479 ms |
100 | TagTable | 5.163 ms | 0.1018 ms | 0.1358 ms |
1000 | TagTable | 25.545 ms | 0.4952 ms | 0.4864 ms |
10000 | TagTable | 441.877 ms | 3.5410 ms | 2.9569 ms |
1.5.2-beta1 April 12 2023
NOTE: This beta release is intended for greenfield projects only.
Until backward compatibility is properly tested and documented, it is recommended to use this plugin only on new greenfield projects that does not rely on existing persisted data.
Akka.Persistence.Sql is a successor of Akka.Persistence.Linq2Db. It is being retooled to provide a better inter-compatibility with other SQL based Akka.Persistence plugin family.
Currently supported database family:
- Microsoft SQL Server
- MS SQLite
- System.Data.SQLite
- PostgreSQL using binary payload
Akka.Hosting Extension Setup
Assuming a MS SQL Server 2019 setup:
var host = new HostBuilder()
.ConfigureServices((context, services) => {
services.AddAkka("my-system-name", (builder, provider) =>
{
builder.WithSqlPersistence(
connectionString: _myConnectionString,
providerName: ProviderName.SqlServer2019)
});
})
ProviderName is a string constant defining the database type to connect to, valid values are defined inside LinqToDB.ProviderName
static class. Refer to the Members of LinqToDb.ProviderName
for included providers.
HOCON Configuration Setup
akka.persistence {
journal {
plugin = "akka.persistence.journal.sql"
sql {
connection-string = "{database-connection-string}"
provider-name = "{provider-name}"
}
}
snapshot-store {
plugin = "akka.persistence.snapshot-store.sql"
sql {
connection-string = "{database-connection-string}"
provider-name = "{provider-name}"
}
}
}
- database-connection-string: The proper connection string to your database of choice.
- provider-name: A string constant defining the database type to connect to, valid values are defined inside
LinqToDB.ProviderName
static class. Refer to the Members ofLinqToDb.ProviderName
for included providers.
Changes:
- c1a8987 Update RELEASE_NOTES.md for 1.5.24 release (#405)
- c2c51f9 Make sure that generated query config is valid (#404)
- 8f47e1e build(deps): bump jetbrains.resharper.globaltools (#401)
- f2424a7 build(deps): bump MicrosoftSqliteVersion from 8.0.4 to 8.0.6 (#394)
- 6a7df44 build(deps): bump Microsoft.Data.SqlClient from 5.2.0 to 5.2.1 (#395)
- 91982c4 build(deps): bump AkkaHostingVersion from 1.5.20 to 1.5.24 (#400)
- 1b47872 build(deps): bump Akka.Persistence.Redis from 1.5.13 to 1.5.24 (#402)
- 52ca6c9 build(deps): bump Akka.Persistence.PostgreSql from 1.5.15.1 to 1.5.20 (#387)
- 5f3091a build(deps): bump AkkaVersion from 1.5.20 to 1.5.24 (#399)
- 7eb5a39 build(deps): bump Microsoft.NET.Test.Sdk from 17.9.0 to 17.10.0 (#390)