From 4b27bc34a882b10fe5beb52fdf174536c5893923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Thu, 30 Jul 2020 10:43:16 +0200 Subject: [PATCH] Document hot standby for replicated event sourcing (#29439) --- .../src/main/paradox/typed/replicated-eventsourcing.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/akka-docs/src/main/paradox/typed/replicated-eventsourcing.md b/akka-docs/src/main/paradox/typed/replicated-eventsourcing.md index df09cd5049..f1073f7a2b 100644 --- a/akka-docs/src/main/paradox/typed/replicated-eventsourcing.md +++ b/akka-docs/src/main/paradox/typed/replicated-eventsourcing.md @@ -287,6 +287,12 @@ The "event publishing" feature publishes each event to the local system event bu the @apidoc[ShardingDirectReplication] actor subscribes to these events and forwards them to the replicas allowing them to fast forward the stream of events for the origin replica. (With additional potential future support in journals for fast forwarding [#29311](https://github.com/akka/akka/issues/29311)). +## Hot Standby + +If all writes occur to one replica the other replicas are not started there might be many replicated events to catch up with when they are later started. Therefore it can be good to activate all replicas when there is some activity. + +This can be achieved automatically when `ReplicatedSharding` is used and direct replication of events is enabled as described in @ref[Direct Replication of Events](#direct-replication-of-events). When each written event is forwarded to the other replicas it will trigger them to start if they are not already started. + ## Journal Support For a journal plugin to support replication it needs to store and read metadata for each event if it is defined in the @apiref[PersistentRepr] @@ -295,4 +301,4 @@ For a journal plugin to support replication it needs to store and read metadata For a snapshot plugin to support replication it needs to store and read metadata for the snapshot if it is defined in the @apiref[akka.persistence.SnapshotMetadata] `metadata` field. To attach the metadata when reading the snapshot the `akka.persistence.SnapshotMetadata.apply` factory overload taking a `metadata` parameter is used. -The @apidoc[SnapshotStoreSpec] in the Persistence TCK provides a capability flag `supportsMetadata` to toggle verification that metadata is handled correctly. \ No newline at end of file +The @apidoc[SnapshotStoreSpec] in the Persistence TCK provides a capability flag `supportsMetadata` to toggle verification that metadata is handled correctly.