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

Add shard key in context #499

Merged
merged 3 commits into from
Mar 23, 2023
Merged

Add shard key in context #499

merged 3 commits into from
Mar 23, 2023

Conversation

hackerwins
Copy link
Member

@hackerwins hackerwins commented Mar 23, 2023

What this PR does / why we need it:

Append shard key metadata to SDK's requests.

We recently introduced key-based sharding on the cluster. This commit appends the shard key(x-shard-key) to SDK's requests to do load balancing from Destination Rule in Istio.

We can group SDK APIs into project-based and document-based.

The value of x-shard-key of project-based APIs such as ActivateClient consists only of public-api-key that can represent a project.

And the value of x-shard-key of document-based APIs such as AttachDocument is {public-api-key}/{document-key} that can represent a document in the project.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Merging #499 (370a18e) into main (ead453c) will increase coverage by 0.26%.
The diff coverage is 14.51%.

@@            Coverage Diff             @@
##             main     #499      +/-   ##
==========================================
+ Coverage   48.33%   48.60%   +0.26%     
==========================================
  Files          69       69              
  Lines        5896     5919      +23     
==========================================
+ Hits         2850     2877      +27     
+ Misses       2705     2696       -9     
- Partials      341      346       +5     
Impacted Files Coverage Δ
client/client.go 15.73% <12.06%> (+5.45%) ⬆️
client/auth.go 78.12% <50.00%> (+21.87%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@hackerwins hackerwins marked this pull request as ready for review March 23, 2023 10:40
@hackerwins hackerwins merged commit 3022eec into main Mar 23, 2023
@hackerwins hackerwins deleted the add-shard-key branch March 23, 2023 10:42
7hong13 added a commit to yorkie-team/yorkie-android-sdk that referenced this pull request Jun 5, 2023
* Apply integration of SDK and admin RPC server

* add x-shard-key(ref: yorkie-team/yorkie#499)

---------

Co-authored-by: Kevin Park <krapi0314@gmail.com>
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.

None yet

2 participants