Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Small improvements to Replicated Event Sourcing docs #32244

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ add or remove of items in any data center will eventually lead to all data cente
each product.

Scala
: @@snip [AuctionExample](/akka-persistence-typed-tests/src/test/scala/docs/akka/persistence/typed/ReplicatedShoppingCartExampleSpec.scala) { #shopping-cart }
: @@snip [ShoppingCartExample](/akka-persistence-typed-tests/src/test/scala/docs/akka/persistence/typed/ReplicatedShoppingCartExampleSpec.scala) { #shopping-cart }

Java
: @@snip [AuctionExample](/akka-persistence-typed-tests/src/test/java/jdocs/akka/persistence/typed/ReplicatedShoppingCartExample.java) { #shopping-cart }
: @@snip [ShoppingCartExample](/akka-persistence-typed-tests/src/test/java/jdocs/akka/persistence/typed/ReplicatedShoppingCartExample.java) { #shopping-cart }

With this model we cannot have a `ClearCart` command as that could give different states in different data centers.
It is quite easy to imagine such a scenario: commands arriving in the order `ClearCart`, `AddItem('a', 5)` in one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@ The following are more realistic examples of building systems with Replicated Ev

See also the @extref[Akka Projection gRPC documentation](akka-projection:grpc-replicated-event-sourcing-transport.html) with details on setting up the gRPC replication transport.

Additionally, complete samples using the recommended gRPC transport set up can be found in the Akka Projection github repository:

* [Replicated shopping cart service in Scala](https://github.com/akka/akka-projection/tree/main/samples/replicated/shopping-cart-service-scala)
* [Replicated shopping cart service in Java](https://github.com/akka/akka-projection/tree/main/samples/replicated/shopping-cart-service-java)
Additionally, complete samples using the recommended gRPC transport set up can be found in the @extref[Akka Distributed Cluster Guide](akka-distributed-cluster:guide/3-active-active.html).

10 changes: 5 additions & 5 deletions akka-docs/src/main/paradox/typed/replicated-eventsourcing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ This restriction means that in the event of network partitions, and for a short

Replicated Event Sourcing enables running multiple replicas of each entity.
There is automatic replication of every event persisted to all replicas.
This makes it possible to implement patterns such as active-active and hot standby.

For instance, a replica can be run per:

* Cloud provider region
* Data Center
* Availability zone or rack

The motivations are:

* Redundancy to tolerate failures in one location and still be operational
* Serve requests from a location near the user to provide better responsiveness
* Allow updates to an entity from several locations
* Balance the load over many servers

However, the event handler must be able to **handle concurrent events** as when replication is enabled
Expand Down Expand Up @@ -61,10 +64,7 @@ Since Akka 2.8.0 a gRPC based transport is the recommended way to set up the rep
The functionality is provided through the Akka Projection gRPC module, see the details about
how to use it up in the @extref[Akka Projection gRPC documentation](akka-projection:grpc-replicated-event-sourcing-transport.html)

Complete samples of the gRPC transport set up can be found in the Akka Projection github repository:

* [Replicated shopping cart service in Scala](https://github.com/akka/akka-projection/tree/main/samples/replicated/shopping-cart-service-scala)
* [Replicated shopping cart service in Java](https://github.com/akka/akka-projection/tree/main/samples/replicated/shopping-cart-service-java)
Complete samples of the gRPC transport set up can be found in the @extref[Akka Distributed Cluster Guide](akka-distributed-cluster:guide/3-active-active.html).

### Consuming events via direct access to replica databases

Expand Down Expand Up @@ -296,4 +296,4 @@ The @apidoc[SnapshotStoreSpec] in the Persistence TCK provides a capability flag

The following plugins support Replicated Event Sourcing over gRPC:

* [Akka Persistence R2DBC](https://doc.akka.io/docs/akka-persistence-r2dbc/current/) versions 1.1.0+
* [Akka Persistence R2DBC](https://doc.akka.io/docs/akka-persistence-r2dbc/current/) versions 1.1.0+
2 changes: 2 additions & 0 deletions project/Paradox.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ object Paradox {
"extref.akka.http.base_url" -> "https://doc.akka.io/docs/akka-http/current/%s",
"extref.akka-management.base_url" -> "https://doc.akka.io/docs/akka-management/current/%s",
"extref.akka-projection.base_url" -> "https://doc.akka.io/docs/akka-projection/current/%s",
"extref.akka-distributed-cluster.base_url" -> "https://doc.akka.io/docs/akka-distributed-cluster/current/%s",
"extref.akka-edge.base_url" -> "https://doc.akka.io/docs/akka-edge/current/%s",
"extref.platform-guide.base_url" -> "https://developer.lightbend.com/docs/akka-guide/%s",
"extref.wikipedia.base_url" -> "https://en.wikipedia.org/wiki/%s",
"extref.github.base_url" -> (GitHub.url(version.value) + "/%s"), // for links to our sources
Expand Down