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

Remove read only from most query persistence API's #1157

Merged
merged 1 commit into from Feb 10, 2022

Conversation

tgianos
Copy link
Contributor

@tgianos tgianos commented Feb 9, 2022

Given the unknown nature of how the system is deployed readOnly = true can behave in different ways.

For example with amazon aurora and the mariadb driver if you set readOnly = true it will send all the requests to a read
replica endpoint which is subject to lag and inconsistency. There is no serializable isolation level. While the potential
benefits here are nice it is not worth the risk of side effects both within the system codebase itself as modules are replaced
with unknown implementations or to the REST API clients who expect consistent responses (e.g. read after write from HTTP 200 responses).

Removing readOnly = true from all but the non-critical search API's may slow down some performance due to JPA flush and
context evaluation but the consistency gaurantees are likely worth the tradeoff for most of these queries which are point
queries anyway to index backed columns.

Given the unknown nature of how the system is deployed `readOnly = true` can behave in different ways.

For example with amazon aurora and the mariadb driver if you set `readOnly = true` it will send all the requests to a read
replica endpoint which is subject to lag and inconsistency. There is no serializable isolation level. While the potential
benefits here are nice it is not worth the risk of side effects both within the system codebase itself as modules are replaced
with unknown implementations or to the REST API clients who expect consistent responses (e.g. read after write from HTTP 200 responses).

Removing `readOnly = true` from all but the non-critical search API's may slow down some performance due to JPA flush and
context evaluation but the consistency gaurantees are likely worth the tradeoff for most of these queries which are point
queries anyway to index backed columns.
@tgianos tgianos added this to the 4.2.0 milestone Feb 9, 2022
@tgianos tgianos requested a review from nvhoang February 9, 2022 23:20
@tgianos tgianos self-assigned this Feb 9, 2022
@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.788% when pulling 1362fde on tgianos:removeMostReadOnly into a30f71c on Netflix:master.

@tgianos tgianos merged commit 399cd07 into Netflix:master Feb 10, 2022
@tgianos tgianos deleted the removeMostReadOnly branch February 10, 2022 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants