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

Migration to Redis #34

Open
3 tasks
kzalys opened this issue Feb 1, 2020 · 0 comments
Open
3 tasks

Migration to Redis #34

kzalys opened this issue Feb 1, 2020 · 0 comments

Comments

@kzalys
Copy link
Collaborator

kzalys commented Feb 1, 2020

After analyzing the use case of this service more I realized that Redis would suit hs_auth better than MongoDB as the data storage technology.

Why Redis?

  • Performance. Redis is an in-memory key value store which means it is much faster than MongoDB which stores data on the disk. Considering the fact that auth methods on hs_auth are called pretty much whenever any call is made to any hs service, improvements in response time should lead to the performance of the entire system and, as a result, a better user experience. Though the real performance impact is yet to be determined and I will be adding more information to this issue once I've performed some tests.
  • Persistence. In-memory datastores usually only store the data in memory which means that when the datastore process is killed, all data is lost. Redis is different to other in-memory datastores by supporting on-disk persistence meaning that even if the host goes down, the data will not be lost.

Things to note:

  • Redis uses the memory rather than the disk to store data which means that a large amount of memory would be required if the amount of data to store gets large. However, in the case of hs_auth each user can create at most 2 objects on the database (the user object and a team object). Considering we will most likely never have more than 300 users, the amount of memory required to store all of hs_auth's data would be minimal.

Things to do:

  • Implement an interface for storing user and team objects on Redis
  • Update the docker setup deploy Redis instead of MongoDB
  • Allow the developer to choose wether to use Redis or MongoDB (low priority)
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

No branches or pull requests

1 participant