Skip to content

Commit 8052a17

Browse files
authored
Update documentations (#287)
1 parent 34507d8 commit 8052a17

File tree

7 files changed

+199
-931
lines changed

7 files changed

+199
-931
lines changed

README.md

Lines changed: 16 additions & 809 deletions
Large diffs are not rendered by default.

docs/articles/configuration.md

Lines changed: 59 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ title: Configuration
55

66
# Configuration
77

8+
# Journal
9+
810
Please note that you -must- provide a Connection String (`connection-string`) and Provider name (`provider-name`).
911

1012
## `parallelism`
1113

1214
Controls the number of Akka.Streams Queues used to write to the DB. Default in JVM is `8`. We use `3`
1315

14-
- For SQL Server, Based on testing `3` is a fairly optimal number in .NET and and thus chosen as default. You may wish to adjust up if you are dealing with a large number of actors.
16+
- For SQL Server, Based on testing `3` is a fairly optimal number in .NET and and thus chosen as default. You may wish to adjust up if you are dealing with a large number of actors.
1517

16-
Testing indicates that `2` will provide performance on par or better than both batching and non-batching journal.
18+
Testing indicates that `2` will provide performance on par or better than both batching and non-batching journal.
1719

18-
- For SQLite, you may want to just put `1` here, because SQLite allows at most a single writer at a time even in WAL mode.
20+
- For SQLite, you may want to just put `1` here, because SQLite allows at most a single writer at a time even in WAL mode.
1921

20-
Keep in mind there may be some latency/throughput trade-offs if your write-set gets large.
22+
Keep in mind there may be some latency/throughput trade-offs if your write-set gets large.
2123

2224
Note that unless `materializer-dispatcher` is changed, by default these run on the thread pool, not on dedicated threads. Setting this number too high may steal work from other actors.
2325

@@ -31,12 +33,7 @@ You can define a different dispatcher here if worried about stealing from the th
3133

3234
## `delete-compatibility-mode`
3335

34-
specifies to perform deletes in a way that is compatible with Akka.Persistence.Sql.Common. This will use a journal metadata table
35-
36-
## `use-clone-connection`
37-
is a bit of a hack. Currently Linq2Db has a performance penalty for custom mapping schemas. Cloning the connection is faster but may not work for all scenarios.
38-
39-
tl;dr - If a password or similar is in the connection string, leave `use-clone-connection` set to `false`. If you don't have a password or similar, run some tests with it set to `true`. You'll see improved write and read performance.
36+
specifies to perform deletes in a way that is compatible with `Akka.Persistence.Sql.Common`. This will use a journal metadata table
4037

4138
# Batching options
4239

@@ -66,7 +63,7 @@ Note that Tables/Columns will be created with the casing provided, and selected
6663

6764
## Journal And Query
6865

69-
> [!NOTE]
66+
> ### NOTE
7067
> Please note that you -must- provide a Connection String and Provider name.
7168
7269
```hocon
@@ -75,16 +72,11 @@ akka.persistence {
7572
sql {
7673
class = "Akka.Persistence.Sql.Journal.SqlWriteJournal, Akka.Persistence.Sql"
7774
plugin-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"
78-
79-
# Connection String is Required!
80-
connection-string = ""
75+
connection-string = "" # Connection String is Required!
8176
82-
# Provider name is required!
83-
# Refer to LinqToDb.ProviderName for values
84-
# Always use a specific version if possible
85-
# To avoid provider detection performance penalty
86-
# Don't worry if your DB is newer than what is listed;
87-
# Just pick the newest one (if yours is still newer)
77+
# Provider name is required, refer to LinqToDb.ProviderName for values
78+
# Always use a specific version if possible to avoid provider detection performance penalty
79+
# Don't worry if your DB is newer than what is listed; just pick the newest one (if yours is still newer)
8880
provider-name = ""
8981
9082
# If true, journal_metadata is created and used for deletes
@@ -115,7 +107,7 @@ akka.persistence {
115107
# This batch size controls the maximum number of rows that will be sent
116108
# In a single round trip to the DB. This is different than the -actual- batch size,
117109
# And intentionally set larger than batch-size,
118-
# to help atomic writes be faster
110+
# to help atomicwrites be faster
119111
# Note that Linq2Db may use a lower number per round-trip in some cases.
120112
db-round-trip-max-batch-size = 1000
121113
@@ -157,8 +149,8 @@ akka.persistence {
157149
158150
# This setting dictates how journal event tags are being stored inside the database.
159151
# Valid values:
160-
# * Csv
161-
# This value will make the plugin stores event tags in a CSV format in the
152+
# * Csv
153+
# This value will make the plugin stores event tags in a CSV format in the
162154
# `tags` column inside the journal table. This is the backward compatible
163155
# way of storing event tag information.
164156
# * TagTable
@@ -188,27 +180,35 @@ akka.persistence {
188180
# If set to null, the default `System.Object` serializer is used.
189181
serializer = null
190182
183+
# The isolation level of all database read queries.
184+
# Isolation level documentation can be read here:
185+
# https://learn.microsoft.com/en-us/dotnet/api/system.data.isolationlevel?#fields
186+
# Valid values: "read-committed", "read-uncommitted", "repeatable-read", "serializable", "snapshot", or "unspecified"
187+
read-isolation-level = unspecified
188+
189+
# The isolation level of all database write queries.
190+
# Isolation level documentation can be read here:
191+
# https://learn.microsoft.com/en-us/dotnet/api/system.data.isolationlevel?#fields
192+
# Valid values: "read-committed", "read-uncommitted", "repeatable-read", "serializable", "snapshot", or "unspecified"
193+
write-isolation-level = unspecified
194+
191195
# Default table name and column name mapping
192196
# Use this if you're not migrating from old Akka.Persistence plugins
193197
default {
194198
# If you want to specify a schema for your tables, you can do so here.
195199
schema-name = null
196200
197201
journal {
198-
# A flag to indicate if the writer_uuid column should
199-
# be generated and be populated in run-time.
200-
# Notes:
201-
# 1. The column will only be generated if auto-initialize is
202-
# set to true.
203-
# 2. This feature is Akka.Persistence.Sql specific, setting
204-
# this to true will break backward compatibility with
205-
# databases generated by other Akka.Persistence plugins.
206-
# 3. To make this feature work with legacy plugins,
207-
# you will have to alter the old journal table:
202+
# A flag to indicate if the writer_uuid column should be generated and be populated in run-time.
203+
# Notes:
204+
# 1. The column will only be generated if auto-initialize is set to true.
205+
# 2. This feature is Akka.Persistence.Sql specific, setting this to true will break
206+
# backward compatibility with databases generated by other Akka.Persistence plugins.
207+
# 3. To make this feature work with legacy plugins, you will have to alter the old
208+
# journal table:
208209
# ALTER TABLE [journal_table_name] ADD [writer_uuid_column_name] VARCHAR(128);
209-
# 4. If set to true, the code will not check for backward
210-
# compatibility. It will expect that the `writer-uuid`
211-
# column to be present inside the journal table.
210+
# 4. If set to true, the code will not check for backward compatibility. It will expect
211+
# that the `writer-uuid` column to be present inside the journal table.
212212
use-writer-uuid-column = true
213213
214214
table-name = "journal"
@@ -377,8 +377,8 @@ akka.persistence {
377377
378378
# This setting dictates how journal event tags are being read from the database.
379379
# Valid values:
380-
# * Csv
381-
# This value will make the plugin read event tags from a CSV formatted string
380+
# * Csv
381+
# This value will make the plugin read event tags from a CSV formatted string
382382
# `tags` column inside the journal table. This is the backward compatible
383383
# way of reading event tag information.
384384
# * TagTable
@@ -445,6 +445,12 @@ akka.persistence {
445445
446446
tag-separator = ";"
447447
448+
# The isolation level of all database read query.
449+
# Isolation level documentation can be read here:
450+
# https://learn.microsoft.com/en-us/dotnet/api/system.data.isolationlevel?#fields
451+
# Valid values: "read-committed", "read-uncommitted", "repeatable-read", "serializable", "snapshot", or "unspecified"
452+
read-isolation-level = unspecified
453+
448454
dao = "Akka.Persistence.Sql.Journal.Dao.ByteArrayJournalDao, Akka.Persistence.Sql"
449455
450456
default = ${akka.persistence.journal.sql.default}
@@ -456,12 +462,11 @@ akka.persistence {
456462
}
457463
}
458464
}
459-
460465
```
461466

462467
## Snapshot Store
463468

464-
> [!NOTE]
469+
> ### NOTE
465470
> Please note that you -must- provide a Connection String and Provider name.
466471
467472
```hocon
@@ -487,7 +492,7 @@ akka.persistence {
487492
# The database schema, table names, and column names configuration mapping.
488493
# The details are described in their respective configuration block below.
489494
# If set to "sqlite", "sql-server", "mysql", or "postgresql",
490-
# column names will be compatible with Akka.Persistence.Sql
495+
# column names will be compatible with legacy Akka.NET persistence sql plugins
491496
table-mapping = default
492497
493498
# Default serializer used as manifest serializer when applicable and payload serializer when
@@ -500,12 +505,23 @@ akka.persistence {
500505
# if true, tables will attempt to be created.
501506
auto-initialize = true
502507
503-
# if true, a warning will be logged
504-
# if auto-init of tables fails.
508+
# if true, a warning will be logged if auto-init of tables fails.
505509
# set to false if you don't want this warning logged
506510
# perhaps if running CI tests or similar.
507511
warn-on-auto-init-fail = true
508512
513+
# The isolation level of all database read query.
514+
# Isolation level documentation can be read here:
515+
# https://learn.microsoft.com/en-us/dotnet/api/system.data.isolationlevel?#fields
516+
# Valid values: "read-committed", "read-uncommitted", "repeatable-read", "serializable", "snapshot", or "unspecified"
517+
read-isolation-level = unspecified
518+
519+
# The isolation level of all database read query.
520+
# Isolation level documentation can be read here:
521+
# https://learn.microsoft.com/en-us/dotnet/api/system.data.isolationlevel?#fields
522+
# Valid values: "read-committed", "read-uncommitted", "repeatable-read", "serializable", "snapshot", or "unspecified"
523+
write-isolation-level = unspecified
524+
509525
default {
510526
schema-name = null
511527
snapshot {

docs/articles/features.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ title: Features/Architecture
1414

1515
- Linq2Db usage for easier swapping of backend DBs.
1616
- `provider-name` is a [`LinqToDb.ProviderName`](https://linq2db.github.io/api/LinqToDB.ProviderName.html)
17-
- This handles DB Type mapping and Dialect-specific query building
17+
- This handles DB Type mapping and Dialect-specific query building
1818

1919
- language-ext is used in place of Systems.Collections.Immutable where appropriate
2020
- Lower memory allocations, improve performance
@@ -45,15 +45,13 @@ title: Features/Architecture
4545
## Currently Implemented
4646

4747
- Journal
48-
- With `JournalSpec` and `JournalPerfSpec` passing for MS SQL Server, Microsoft.Data.SQLite, and PostgreSQL
48+
- With `JournalSpec` and `JournalPerfSpec` passing for MS SQL Server, Microsoft.Data.SQLite, PostgreSQL, and MySql.
4949
- Snapshot Store
50-
- With `SnapshotStoreSpec` passing for MS SQL Server, Microsoft.Data.SQLite, PostgreSQL
50+
- With `SnapshotStoreSpec` passing for MS SQL Server, Microsoft.Data.SQLite, PostgreSQL, and MySql.
5151
- Configuration
52-
- Only Functional tests at this time.
5352
- Custom provider configurations are supported.
5453
- Compatibility with existing Akka.Persistence plugins is implemented via `table-mapping` setting.
5554

5655
## Incomplete
5756

58-
- Tests for Schema Usage
59-
- Cleanup of Configuration classes/fallbacks.
57+
- Tests for Schema Usage

docs/articles/gettingStarted.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Getting Started
77

88
## The Easy `Akka.Hosting` Way
99

10-
> [!NOTE]
10+
> #### NOTE
1111
> `connectionString` and `providerName` parameters are mandatory
1212
1313
Assuming a Microsoft SQL Server 2019 setup:
@@ -23,12 +23,12 @@ var host = new HostBuilder()
2323
})
2424
```
2525

26-
> [!NOTE]
26+
> #### NOTE
2727
> For best performance, one should use the most specific provider name possible. i.e. `LinqToDB.ProviderName.SqlServer2019` instead of `LinqToDB.ProviderName.SqlServer`. Otherwise certain provider detections have to run more frequently which may impair performance slightly.
2828

2929
## The Classic HOCON Way
3030

31-
> [!NOTE]
31+
> #### NOTE
3232
> `connection-string` and `provider-name` properties are mandatory
3333

3434
These are the minimum HOCON configuration you need to start using Akka.Persistence.Sql:

0 commit comments

Comments
 (0)