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

Update cluster sharding documentation #5421

Merged
merged 9 commits into from
Dec 10, 2021

Conversation

Arkatufus
Copy link
Contributor

Closes #5401

  • Add a non-persistent cluster sharding example for the tutorial
  • Update the old cluster sharding example to support docker and docker-compose
  • Add a tutorial section to the cluster sharding documentation

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but we need to use the right DocFx tools for linking to documentation - helps us make sure that samples on the website don't rot between releases.

specialized projects but in this example, we will roll them into a single project and control their
roles using an environment variable.

```c#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to use DocFx Code Snippets for samples https://dotnet.github.io/docfx/spec/docfx_flavored_markdown.html#code-snippet-sample

That way when code gets refactored, the samples on the website are automatically updated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply this to all code samples in this PR


### Starting the Sharding Coordinator Actors

There are two types of sharding coordinator actors; a normal coordinator coordinates messages and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a bulleted list to spell out both types of actors and make it clear that if you have a ShardRegion you don't also need a ShardRegionProxy to communicate with those sharded actors


### Sending Messages To the Sharded Actors

Finally we can start sending messages to the sharded actors through the proxy coordinator actor.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the front end node to the back end node?

### Message Envelope and Message Extractor

The shard coordinator would need to know which shard and entity it needs to send the messages to,
we do that by embedding the entity and shard id information in the envelope we send the message in.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shard id information in the envelope we send the message in

shard id information in the messages we send to the it. In this case, we're using a custom ShardEnvelope message type to wrap all of our messages.

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

specialized projects but in this example, we will roll them into a single project and control their
roles using an environment variable.

[!code-csharp[Program.cs](../../../src/examples/Cluster/ClusterSharding/ShoppingCart/Program.cs?name=RoleSetup "Setting up node roles")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb merged commit 1cf4156 into akkadotnet:dev Dec 10, 2021
@Aaronontheweb Aaronontheweb mentioned this pull request Dec 13, 2021
@Arkatufus Arkatufus deleted the DOC_Cluster_Sharding branch December 13, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Akka.Cluster.Sharding needs better documentation.
2 participants