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

[TT-1969] - Gateway should synchronise only changed objects from the dashboard or MDCB #2803

Open
buger opened this issue Jan 14, 2020 · 1 comment

Comments

@buger
Copy link
Member

buger commented Jan 14, 2020

Is your feature request related to a problem? Please describe.
At the moment, if you have lot of policies or APIs (thousands), each gateway reload takes a lot of time (up to a minute). And any policy or api change/update can trigger such reload.

In some of the flows, it is required dynamically update policies, and such delays could be unacceptable.

Describe the solution you'd like
It will be great if we will be able to just sync only the APIs/Policies, which actually got changed.
Dashboard/MDCB can define new APIs, which accept gateway current state like this:

{
  "policies": {"<policy-id>": "<last-updated-date>"},
  "apis": {"<api-id>": "<last-updated-date>"} 
}

And in response it should get response like:

{
   "updated": {"<policy-id>": <policy-object>},
   "deleted": ["<policy-id>"],
   "created": {"<policy-id>": <policy-object>},
}

The same response should be for the APIs.

We can make it backward compatible, and first check new "POST" endpoint, and after old "GET" endpoint.

@matiasinsaurralde
Copy link
Contributor

Update: I've started to work on this, first on the gateway side. For now I've isolated all the functionality into a function inside DoReload so that's called instead of syncPolicies and syncAPISpecs (from the above description I've assumed that we'll unify both calls).
An interesting finding is that we don't currently have a last_updated field in the API definition. Will need to handle this on the dashboard side. I will focus on the dashboard side today.

matiasinsaurralde added a commit to matiasinsaurralde/tyk that referenced this issue Mar 10, 2020
@vverbani vverbani changed the title Gateway should synchronise only changed objects from the dashboard or MDCB [TT-1969] - Gateway should synchronise only changed objects from the dashboard or MDCB Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants