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

Allowed talking to redis sentinel by changing the redis client to ioredis. #214

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

abdoolly
Copy link

This pull request is proposed to solve this issue

Problem statement
The problem was that the current state of hydra make it very hard for it to work in a high availability environment specifically in talking with redis since the current client that is used does not support
redis modes of working in high availability.

Solution
So , what this pull request do is that I have changed the main redis client which is node_redis to the more advanced redis client which is ioredis that supports redis cluster mode , and redis redis sentinel.
and actually that's all we need to make hydra work in high availability.

change description:
The change as said above is just changing the main connection from node_redis to ioredis .I did not to change most of the commands since ioredis have similar api to node_redis I have also used this guide for migrating which shows the difference between both clients.

so the main changes are

  • changed the main redis connection
  • made new function for handling multi result since it's a bit different also it is backward compatible if we wanted to still use the node_Redis.
  • made a new function to handle if we should use .batch if node_Redis and pipeline if ioredis which is the equivalent of .batch in ioredis
  • also I have passed the tests so all tests are passing.

Also later on I will be making a small guide to be used on how to install and deploy hydra with redis in high availability environment in kubernetes.
Thanks

Copy link
Contributor

@cjus cjus left a comment

Choose a reason for hiding this comment

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

Thanks for this pull request. Unfortunately, your editor seems to have made formatting changes that have nothing to do with the actual nature of the pull request. I'm going to assign this PR to one of our team members - but in the mean time would you mind reverting and applying your PR without the code formatting (white space) changes?

@abdoolly
Copy link
Author

I have made a commit that removed the white spaces and only the main changes are remaining now.

pull request related things
@abdoolly abdoolly requested a review from cjus September 22, 2019 10:07
- fixed service name with port not recognizing http method
now external service does not need to check their presence as the internal services
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

3 participants