![]() |
VOOZH | about |
dotnet add package Linker.Core --version 1.0.13-james
NuGet\Install-Package Linker.Core -Version 1.0.13-james
<PackageReference Include="Linker.Core" Version="1.0.13-james" />
<PackageVersion Include="Linker.Core" Version="1.0.13-james" />Directory.Packages.props
<PackageReference Include="Linker.Core" />Project file
paket add Linker.Core --version 1.0.13-james
#r "nuget: Linker.Core, 1.0.13-james"
#:package Linker.Core@1.0.13-james
#addin nuget:?package=Linker.Core&version=1.0.13-james&prereleaseInstall as a Cake Addin
#tool nuget:?package=Linker.Core&version=1.0.13-james&prereleaseInstall as a Cake Tool
This library is for replicating user data between EventStore clusters or single instances. More info on this article Cross Data Center Replication with Linker
This app make use of the appsettings.json file to configure Linked EventStore's. You can have as many Links as you need and as your running machine allow you to run. Even when you are replicating at full speed, the Linker logic make use of backpressure tecnique in order to not take the full amount of CPU and Memory available.
One instance is the origin, the other instance is the destination. To configure a simple link with a filter excluding one specific stream:
{
"links": [
{
"origin": {
"connectionString": "esdb://admin:changeit@localhost:2114?tls=false",
"connectionName": "db01"
},
"destination": {
"connectionString": "esdb://admin:changeit@localhost:2115?tls=false",
"connectionName": "db02"
},
"filters": [
{
"filterType": "stream",
"value": "diary-input",
"filterOperation": "exclude"
},
{
"filterType": "stream",
"value": "*",
"filterOperation": "include"
}
]
}
]
}
Configure two links swapping the same Origin and Destination for a multi master ACTIVE-ACTIVE replication
{
"links": [
{
"origin": {
"connectionString": "esdb://admin:changeit@localhost:2114?tls=false",
"connectionName": "db01"
},
"destination": {
"connectionString": "esdb://admin:changeit@localhost:2115?tls=false",
"connectionName": "db02"
},
"filters": []
},
{
"origin": {
"connectionString": "esdb://admin:changeit@localhost:2115?tls=false",
"connectionName": "db02"
},
"destination": {
"connectionString": "esdb://admin:changeit@localhost:2114?tls=false",
"connectionName": "db01"
},
"filters": []
}
]
}
Configure the same Origin in separate Links replicating data to different destination for a Fan-Out solution.
You can have separate Links with different Origins linked with the same Destination for a Fan-In solution.
To use the LinkerService you pass the origin and the destination of the data replication. Eact LinkerService is a link between Origin and Destination. It is possible run multiple LinkerService's for complex scenarios. The Position of the replica can be saved on both sides but it's better to save it on the destination. If you want to control where to save the position you can build your PositionRepository and pass it to the LinkerService.
Without filters, all the user data will be replicated from the Origin to the linked Destination. When you add an exclude filter you must also add at least an include filter to include what else can be replicated.
You can set a inclusion filter to specify which stream or streams are to be replicated. This will automatically exclude anything else. You can use the wildcard * in the stream string so that you can include any stream that start with 'domain-*' for example.
Example to create an inclusive stream filter
var filter = new Filter(FilterType.Stream, "domain-*", FilterOperation.Include);
You can set a filter to exclude one or more streams that are not to be replicated. This will automatically include anything else. You can use the wildcard * in the stream string so that you can exclude any stream that start with 'rawdata-*' for example.
Example to create a filter that exclude all streams starting with the word rawdata-
var filter = new Filter(FilterType.Stream, "rawdata-*", FilterOperation.Exclude);
You can set a inclusion filter to specify which Event Type's are to be replicated. This will automatically exclude any other event type. You can use the wildcard * in the event type string so that you can include any event type that for exampe starts with 'User*'.
Example to create an inclusive stream filter
var filter = new Filter(FilterType.EventType, "User*", FilterOperation.Include);
You can set a filter to exclude one or more EventType's that must not be replicated. This will automatically include any other event type. You can use the wildcard * in the event type string so that you can exclude any event type that for example start with the word Basket.
Example to create a filter that exclude all streams starting with the word Basket
var filter = new Filter(FilterType.EventType, "Basket*", FilterOperation.Exclude);
Use of filters is optional. If you don't set any filter then all the user data will be replicated from origin to destination. If you set for example an Exclude filter then you must set one or more Include to include for example all other streams or eventtypes or only a subset.
Following is an example of building the LinkerService with a couple of Include filters and one Exclude
var service = new LinkerService(origin, destination,
new FilterService(new List<Filter>
{
new Filter(FilterType.EventType, "User*", FilterOperation.Include),
new Filter(FilterType.Stream, "domain-*", FilterOperation.Include),
new Filter(FilterType.EventType, "Basket*", FilterOperation.Exclude)
}), 1000, false);
service.Start().Wait();
One of the problem that this tool solves is related to the lack of built-in backpressure management in the EventStore client's and api's. Running the replication with this program, the logic will continuosly adapt the network settings depending on the number of events being replicated.
The database being replicated is KurrentDb https://github.com/kurrent-io/KurrentDB
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.13-james | 184 | 6/24/2025 |
| 1.0.12-james | 174 | 6/24/2025 |
| 1.0.11-james | 169 | 6/24/2025 |
| 1.0.10-james | 180 | 6/24/2025 |
fix last save global position
project renaming