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

API -> Agent Server communication and connection caching #54

Open
agalitsyn opened this issue Jan 9, 2023 · 0 comments
Open

API -> Agent Server communication and connection caching #54

agalitsyn opened this issue Jan 9, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@agalitsyn
Copy link
Contributor

agalitsyn commented Jan 9, 2023

Currently API calls agent server in direct manner, using model files and db connection.

What I consider to refactor

  • Create AgentServerClient and pin all methods here, mimic for client-server communication. Under the hood it still will use models and direct DB connection, but we will refactor handlers and prepare client layer for future refactoring too, when server API will be ready.
  • Refactor cache layer for server connections (minio + mysql). Move this to client implementation.
    • If we need to get data from server, we will do smth like client := agentServerClient.WithWEndpoint(agentServerHash) and then return a connected client. It means that if we do not have connection, we create it now and put into cache.
    • Return proper error if server is not responding
    • Remove connection if server was deleted using API method
    • Create connection if server was added using API method
    • Use mysql connnector with retry policy, already presented in mysql lib
  • 4 API handlers have similar code for fetching modules - /agents, /agents/hash, /groups, /groups/hash. This needs caching too, probably on AgentServerClient level
@agalitsyn agalitsyn added the enhancement New feature or request label Jan 9, 2023
@agalitsyn agalitsyn added this to the Technical release milestone Jan 9, 2023
@agalitsyn agalitsyn self-assigned this Jan 9, 2023
@agalitsyn agalitsyn added this to SOLDR Jan 9, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in SOLDR Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant