Akka.Persistence.Sql
1.5.27.1
Prefix Reserved
See the version list below for details.
dotnet add package Akka.Persistence.Sql --version 1.5.27.1
NuGet\Install-Package Akka.Persistence.Sql -Version 1.5.27.1
<PackageReference Include="Akka.Persistence.Sql" Version="1.5.27.1" />
paket add Akka.Persistence.Sql --version 1.5.27.1
#r "nuget: Akka.Persistence.Sql, 1.5.27.1"
// Install Akka.Persistence.Sql as a Cake Addin #addin nuget:?package=Akka.Persistence.Sql&version=1.5.27.1 // Install Akka.Persistence.Sql as a Cake Tool #tool nuget:?package=Akka.Persistence.Sql&version=1.5.27.1
Akka.Persistence.Sql
A Cross-SQL-DB Engine Akka.Persistence plugin with broad database compatibility thanks to Linq2Db.
This is a port of the amazing akka-persistence-jdbc package from Scala, with a few improvements based on C# as well as our choice of data library.
Please read the documentation carefully. Some features may have specific use case and have trade-offs (namely, compatibility modes).
If you're migrating from legacy Akka.Persistence.Sql.Common
based plugins, you can read the migration guide documentation, the migration tutorial, and watch the migration tutorial video.
Table Of Content
- Akka.Persistence.Sql
- Getting Started
- Sql.Common Compatibility modes
- Migration Guide
- Migration Tutorial
- Features/Architecture
- Performance Benchmarks
- Configuration
- Building this solution
Getting Started
The Easy Way, Using Akka.Hosting
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)
});
})
The Classic Way, Using HOCON
These are the minimum HOCON configuration you need to start using Akka.Persistence.Sql:
akka.persistence {
journal {
plugin = "akka.persistence.journal.sql"
sql {
class = "Akka.Persistence.Sql.Journal.SqlWriteJournal, Akka.Persistence.Sql"
connection-string = "{database-connection-string}"
provider-name = "{provider-name}"
}
}
query.journal.sql {
class = "Akka.Persistence.Sql.Query.SqlReadJournalProvider, Akka.Persistence.Sql"
connection-string = "{database-connection-string}"
provider-name = "{provider-name}"
}
snapshot-store {
plugin = "akka.persistence.snapshot-store.sql"
sql {
class = "Akka.Persistence.Sql.Snapshot.SqlSnapshotStore, Akka.Persistence.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.
Note: For best performance, one should use the most specific provider name possible. i.e. LinqToDB.ProviderName.SqlServer2012
instead of LinqToDB.ProviderName.SqlServer
. Otherwise certain provider detections have to run more frequently which may impair performance slightly.
Supported Database Providers
Tested Database Providers
- Microsoft SQL Server
- MS SQLite
- System.Data.SQLite
- PostgreSQL using binary payload
- MySql
Supported By Linq2Db But Untested In Akka.Persistence
- Firebird
- Microsoft Access OleDB
- Microsoft Access ODBC
- IBM DB2
- Informix
- Oracle
- Sybase
- SAP HANA
- ClickHouse
Sql.Common Compatibility modes
- Delete Compatibility mode is available.
- This mode will utilize a
journal_metadata
table containing the last sequence number - The main table delete is done the same way regardless of delete compatibility mode
- This mode will utilize a
Delete Compatibility mode is expensive.
- Normal Deletes involve first marking the deleted records as deleted, and then deleting them
- Table compatibility mode adds an additional InsertOrUpdate and Delete
- This all happens in a transaction
- In SQL Server this can cause issues because of page locks/etc.
Building this solution
To run the build script associated with this solution, execute the following:
Windows
c:\> build.cmd all
Linux / OS X
c:\> build.sh all
If you need any information on the supported commands, please execute the build.[cmd|sh] help
command.
This build script is powered by FAKE; please see their API documentation should you need to make any changes to the build.fsx
file.
Conventions
The attached build script will automatically do the following based on the conventions of the project names added to this project:
- Any project name ending with
.Tests
will automatically be treated as a XUnit2 project and will be included during the test stages of this build script; - Any project name ending with
.Tests
will automatically be treated as a NBench project and will be included during the test stages of this build script; and - Any project meeting neither of these conventions will be treated as a NuGet packaging target and its
.nupkg
file will automatically be placed in thebin\nuget
folder upon running thebuild.[cmd|sh] all
command.
Release Notes, Version Numbers, Etc
This project will automatically populate its release notes in all of its modules via the entries written inside RELEASE_NOTES.md
and will automatically update the versions of all assemblies and NuGet packages via the metadata included inside Directory.Build.props
.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Akka.Persistence.Query (>= 1.5.27.1)
- Akka.Streams (>= 1.5.27.1)
- LanguageExt.Core (>= 4.4.9)
- linq2db (>= 5.4.1)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Linq.Async (>= 6.0.1)
- System.Reactive.Linq (>= 6.0.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Akka.Persistence.Sql:
Package | Downloads |
---|---|
Akka.Persistence.Sql.Hosting
Package Description |
|
FCQRS
Package Description |
|
Akka.Persistence.Sql.HelperLib
Package Description |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Akka.Persistence.Sql:
Repository | Stars |
---|---|
Aaronontheweb/InMemoryCQRSReplication
Akka.NET Reference Architecture - CQRS + Sharding + In-Memory Replication
|
Version | Downloads | Last updated |
---|---|---|
1.5.30 | 4,192 | 10/4/2024 |
1.5.28 | 1,466 | 9/9/2024 |
1.5.27.1 | 5,838 | 8/1/2024 |
1.5.27 | 106 | 7/30/2024 |
1.5.26 | 561 | 7/9/2024 |
1.5.25 | 2,058 | 6/17/2024 |
1.5.24 | 477 | 6/13/2024 |
1.5.20 | 1,684 | 5/10/2024 |
1.5.13 | 15,396 | 9/27/2023 |
1.5.12 | 2,206 | 8/8/2023 |
1.5.12-beta1 | 272 | 8/4/2023 |
1.5.9-beta1 | 190 | 7/20/2023 |
1.5.4-beta1 | 1,730 | 4/26/2023 |
1.5.2-beta3 | 1,237 | 4/19/2023 |
1.5.2-beta2 | 275 | 4/14/2023 |
1.5.2-beta1 | 214 | 4/11/2023 |
* [Fix missing "writer-plugin" generation from Akka.Persistence.Sql.Hosting](https://github.com/akkadotnet/Akka.Persistence.Sql/pull/427)