Skip to content

add AZ_AFFINITY_REPLICAS_AND_PRIMARY read strategy example and diagram #236

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

Merged
merged 3 commits into from
May 26, 2025

Conversation

mo-amzn
Copy link
Contributor

@mo-amzn mo-amzn commented Apr 16, 2025

Description

Adding documentation for the new read strategy AzAffinityReplicasAndPrimary
relates to issues valkey-io/valkey-glide#2792 and valkey-io/valkey-glide#3085

Issues Resolved

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.

@mo-amzn
Copy link
Contributor Author

mo-amzn commented Apr 23, 2025

@stockholmux @madolson
can I get a review please?

@adarovadya
Copy link
Contributor

add yourself to the authors as well

In this case, the client attempts to read from a replica in the same AZ. Since none are available in az-2, it falls back to a replica in another AZ, such as az-1 or az-3.
and the average latency is, for example, about 800 microseconds.

![AZ_AFFINITY Read strategy latency example](/assets/media/pictures/AZ_AFFINITY_strategy2.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's confusing that in the first example the "super" client is the AZ_AFFINITY user, but later the "super" client becomes the AZ_AFFINITY_REPLICAS_AND_PRIMARY user.
I suggest having one example that clearly shows all three cases, and explaining when a user should prefer AZ_AFFINITY over AZ_AFFINITY_REPLICAS_AND_PRIMARY, and vice versa.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see this a bit differently. The new example visually clarifies the differences between AZ_AFFINITY and AZ_AFFINITY_REPLICAS_AND_PRIMARY, illustrating real-world scenarios where each one fits best. I'd prefer to retain both examples.

Signed-off-by: Muhammad Awawdi <[email protected]>
Copy link
Member

@stockholmux stockholmux left a comment

Choose a reason for hiding this comment

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

I'm generally fine with the content, but I think you need to add an update notice at the bottom of the blog.

Signed-off-by: Muhammad Awawdi <[email protected]>
@mo-amzn mo-amzn requested review from stockholmux and adarovadya May 7, 2025 09:13
Copy link
Member

@stockholmux stockholmux left a comment

Choose a reason for hiding this comment

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

LGTM

@stockholmux stockholmux merged commit c3b28b8 into valkey-io:main May 26, 2025
1 check passed
zarkash-aws pushed a commit to zarkash-aws/valkey-io.github.io that referenced this pull request Jun 12, 2025
valkey-io#236)

### Description
Adding documentation for the new read strategy
AzAffinityReplicasAndPrimary
relates to issues valkey-io/valkey-glide#2792
and valkey-io/valkey-glide#3085
<!-- Describe what this change achieves-->

### Issues Resolved

<!-- List any issues this PR will resolve. -->
<!-- Example: closes #1234 -->

### Check List
- [x] Commits are signed per the DCO using `--signoff`

By submitting this pull request, I confirm that my contribution is made
under the terms of the BSD-3-Clause License.

---------

Signed-off-by: Muhammad Awawdi <[email protected]>
Signed-off-by: Shai Zarka <[email protected]>
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.

3 participants