pnxtech / hydra

A light-weight library for building distributed applications such as microservices
https://www.hydramicroservice.com
MIT License
645 stars 54 forks source link

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

Open abdoolly opened 4 years ago

abdoolly commented 4 years ago

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

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

abdoolly commented 4 years ago

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