-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
feat(core): allow forcing write connection via forceWriteConnection
#2838
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2838 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 194 194
Lines 11734 11734
Branches 2700 2701 +1
=========================================
Hits 11734 11734
Continue to review full report at Codecov.
|
please dont rebase after you get a review, so we maintain the history |
Are the commits ultimately squashed before merging or does every single commit actually have to make sense? |
Yes, only one commit will go to master and the commit message is based on the PR title (and I can override it when merging). |
Understood. I'll try keep better care in the future. I just had a little fight with commitlint and figured I'd quickly amend the commit. |
Yeah not a big deal for such a small PR, but I started to say this out load when I see it, otherwise things never change :] |
forceWriteConnection
@B4nan @oliversalzburg, in our application the vast majority of queries should run against the master in order to support immediate-read-after-write scenarios, but we do want to use read-replicas for a few specific use-cases (e.g. customer search or analytics queries). Using the pattern above we'd have to add I would like to propose the following (more generic) pattern:
This way the connection resolution strategy is completely configurable and can support all scenarios. Does this sound reasonable to you ? I'm happy to open a PR for it |
Sounds good to me, PR welcome. Given this PR is not yet shipped in stable, I don't mind replacing the newly added |
Awesome change btw :) |
This allows to bypass replica read attempts through the
FindOptions
, by setting theforceWriteConnection
flag.The intent is to allow users to force reads onto a master, if the user assumes that an entity has not been replicated yet.