Skip to content

Implement services caching system #51

Open
@qraimbault

Description

@qraimbault

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

Metadata

Metadata

Labels

featureNew feature or requestgoRelated to golang code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions