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

Support for moving Redis read commands to replica connections #360

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

tom-binary
Copy link
Contributor

Previously all queries execute on the Redis primary servers, since that gives us transactional safety and guaranteed data synchronisation.

In a heavily-loaded cluster, moving read queries out to the replicas can be an acceptable performance tradeoff. Any query which doesn't modify data will be directed to replicas (if any exist - the primary is used otherwise). Writes still go to the primary.

https://redis.io/docs/latest/commands/readonly/

This is disabled by default - you can opt in for the entire process by setting the transport_use_read_replica configuration value, e.g. export MYRIAD_TRANSPORT_USE_READ_REPLICA=1.

@tom-binary tom-binary merged commit 3d4f5e7 into deriv-com:master Nov 6, 2024
1 check passed
@tom-binary tom-binary deleted the feature/redis_replica branch November 6, 2024 02:24
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.

1 participant