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

Implement services caching system #51

Open
qraimbault opened this issue Aug 24, 2019 · 0 comments
Open

Implement services caching system #51

qraimbault opened this issue Aug 24, 2019 · 0 comments
Assignees
Labels
feature New feature or request go Related to golang code
Milestone

Comments

@qraimbault
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Today, you have to reload Cerberus to update data about services from database to make it available.

Describe the solution you'd like
It would be nicer to be able to :

  1. Every time the leader node does its routine, check up what's new in the database and add or update it in Redis (Note in additional context)
  2. When a route is asked, check in memory (in /proxy/services.go#services), if it is: serve
  3. If not in memory, check in Redis
    • If in Redis :
      • Add it in memory (Note in additional context)
      • Return to number 2
    • If not in Redis : 404 not found

Additional context
Database : Implies updatedAt lastChecked in MySQL ans check which one is bigger in go

Mutex : to prevent weird behaviour in case of simultaneous writing, prevent with a mutex concurrent writings in /proxy/services.go#services

Also possible in the future : It will be possible to bypass memory and only rely on Redis for services

@qraimbault qraimbault added feature New feature or request go Related to golang code labels Aug 24, 2019
@qraimbault qraimbault added this to the 1.0 milestone Aug 25, 2019
@qraimbault qraimbault self-assigned this Feb 3, 2020
@qraimbault qraimbault modified the milestone: 1.0 Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request go Related to golang code
Projects
None yet
Development

No branches or pull requests

2 participants