Database server agent
Aspects of the present disclosure are directed to a system comprising a memory having computer-readable instructions stored thereon, and a processor of a database server, the processor executing the computer-readable instructions to generate a request to a control plane for an operation to be performed on the database server, wherein the control plane is configured to communicate with a plurality of database servers having a plurality of agents running thereon, and wherein each of the plurality of agents has a dedicated communication connection with the control plane, publish the request on the dedicated communication connection associated with the agent to send the request to the control plane, receive, on the dedicated communication connection, a response from the control plane, the response comprising a response to the request from a service of the control plane, and execute the operation on the database server based on the response.
1 . A system comprising:
a memory having computer-readable instructions stored thereon; and
a processor of a database server, the processor executing the computer-readable instructions to:
generate a request to a control plane for an operation to be performed on the database server, wherein the control plane is configured to communicate with a plurality of database servers having a plurality of agents running thereon, and wherein each of the plurality of agents has a communication connection with the control plane;
publish the request to a topic of the communication connection associated with the agent, wherein the communication connection comprises a bidirectional communication connection between the database server and the control plane, and wherein publishing the request causes the request to be routed to a service of the control plane;
receive, on the communication connection, a response from the service of the control plane in response to the published request; and
execute the operation on the database server based on the response.
2 . The system of claim 1 , wherein to publish the request to the communication connection, the processor further executes computer-readable instructions to:
generate a modified request from the request by extracting an identifier of a process running on the processor that generated the request, wherein extracting comprises removing the identifier from the request or copying the identifier and creating the modified request without the identifier; and
publish the modified request to a request topic of the communication connection, wherein the communication connection comprises a plurality of topics, each of the plurality of topics configured to send or receive information of a particular type.
3 . The system of claim 2 , wherein the processor further executes computer-readable instructions to modify the response using the extracted identifier; and
route, based on the extracted identifier, the modified response to the process.
4 . The system of claim 1 , wherein the processor further executes computer-readable instructions to subscribe the agent to one or more topics of the communication connection for receiving commands from the control plane and sending requests to the control plane.
5 . The system of claim 4 , wherein the processor further executes computer-readable instructions to:
receive a command from the control plane on a commands topic of the one or more topics;
execute the command; and
publish a result of the executed command on a reply topic of the commands topic.
6 . The system of claim 4 , wherein the processor further executes computer-readable instructions to:
receive a command from the control plane on a commands topic of the one or more topics; and
based on a number of commands being executed exceeding a predetermined threshold, reject the command.
7 . The system of claim 4 , wherein the processor further executes computer-readable instructions to:
receive an operation from the control plane on an operations topic of the one or more topics;
create a process to execute the operation; and
publish a result of the executed operation on a reply topic of the operations topic.
8 . The system of claim 7 wherein to receive the operation from the control plane on the operations topic, the processor further executes computer-readable instructions to:
poll an operations topic of the one or more topics for operations at regular intervals;
create a process to execute an operation; and
publish a result of the executed operation on a reply topic of the operations topic.
9 . The system of claim 4 , wherein to publish the request on the communication connection, the processor further executes computer-readable instructions to:
publish the request on a requests topic of the one or more topics.
10 . The system of claim 4 , wherein to publish the request on the communication connection, the processor further executes computer-readable instructions to:
send, by a first process running on the processor, the request to a messaging library associated with the processor; and
collect, by a second process running on the processor, the request from the messaging library; and
publish, by the second process, the request on a requests topic of the one or more topics.
11 . A non-transitory, computer-readable media comprising computer-readable instructions stored thereon that when executed by a processor of a control plane cause the processor to:
generate a request to a control plane for an operation to be performed on a database server, wherein the control plane is configured to communicate with a plurality of database servers having a plurality of agents running thereon, and wherein each of the plurality of agents has a communication connection with the control plane;
publish the request to a topic of the communication connection associated with the agent, wherein the communication connection comprises a bidirectional communication connection between the database server and the control plane, and wherein publishing the request causes the request to be routed to a service of the control plane via a messaging cluster;
receive, on the communication connection, a response from the service of the control plane in response to the published request; and
execute the operation on the database server based on the response.
12 . The non-transitory, computer-readable media of claim 11 , wherein to publish the request to the communication connection, the instructions further cause the processor to:
generate a modified request from the request by extracting an identifier of a process running on the processor that generated the request, wherein extracting comprises removing the identifier from the request or copying the identifier and creating the modified request without the identifier; and
publish the modified request to a request topic of the communication connection, wherein the communication connection comprises a plurality of topics, each of the plurality of topics configured to send or receive information of a particular type.
13 . The non-transitory, computer-readable media of claim 12 , wherein the instructions further cause the processor to modify the response using the extracted identifier; and
route, based on the extracted identifier, the modified response to the process.
14 . The non-transitory, computer-readable media of claim 11 , wherein the instructions further cause the processor to subscribe the agent to one or more topics of the communication connection for receiving commands from the control plane and sending requests to the control plane.
15 . The non-transitory, computer-readable media of claim 14 , wherein the instructions further cause the processor to:
receive a command from the control plane on a commands topic of the one or more topics;
execute the command; and
publish a result of the executed command on a reply topic of the commands topic.
16 . The non-transitory, computer-readable media of claim 14 , wherein the instructions further cause the processor to:
receive a command from the control plane on a commands topic of the one or more topics; and
based on a number of commands being executed exceeding a predetermined threshold, reject the command.
17 . The non-transitory, computer-readable media of claim 14 , wherein the instructions further cause the processor to:
receive an operation from the control plane on an operations topic of the one or more topics;
create a process to execute the operation; and
publish a result of the executed operation on a reply topic of the operations topic.
18 . The non-transitory, computer-readable media of claim 17 , wherein to receive the operation from the control plane on the operations topic, the instructions further cause the processor to:
poll an operations topic of the one or more topics for operations at regular intervals;
create a process to execute an operation; and
publish a result of the executed operation on a reply topic of the operations topic.
19 . The non-transitory, computer-readable media of claim 14 , wherein to publish the request on the communication connection, the instructions further cause the processor to:
publish the request on a requests topic of the one or more topics.
20 . The non-transitory, computer-readable media of claim 14 , wherein to publish the request on the communication connection, the instructions further cause the processor to:
send, by a first process running on the processor, the request to a messaging library associated with the processor; and
collect, by a second process running on the processor, the request from the messaging library; and
publish, by the second process, the request on a requests topic of the one or more topics.
21 . A method comprising:
generating, by a processor of a database server, a request to a control plane for an operation to be performed on the database server, wherein the control plane is configured to communicate with a plurality of database servers having a plurality of agents running thereon, and wherein each of the plurality of agents has a communication connection with the control plane;
publishing, by the processor, the request to a topic of the communication connection associated with the agent, wherein the communication connection comprises a bidirectional communication connection between the database server and the control plane, and wherein publishing the request causes the request to be routed to a service of the control plane via a messaging cluster;
receiving, by the processor, on the communication connection, a response from the service of the control plane in response to the published request; and
executing, by the processor, the operation on the database server based on the response.
22 . The method of claim 21 , wherein publishing the request to the communication connection comprises:
generating, by the processor, a modified request from the request by extracting an identifier of a process running on the processor that generated the request, wherein extracting comprises removing the identifier from the request or copying the identifier and creating the modified request without the identifier; and
publishing, by the processor, the modified request to a request topic of the communication connection, wherein the communication connection comprises a plurality of topics, each of the plurality of topics configured to send or receive information of a particular type.
23 . The method of claim 22 , further comprising modifying, by the processor, the response using the extracted identifier; and
routing, by the processor, based on the extracted identifier, the modified response to the process.
24 . The method of claim 21 , further comprising subscribing, by the processor, the agent to one or more topics of the communication connection for receiving commands from the control plane and sending requests to the control plane.
25 . The method of claim 24 , further comprising:
receiving, by the processor, a command from the control plane on a commands topic of the one or more topics;
executing, by the processor, the command; and
publishing, by the processor, a result of the executed command on a reply topic of the commands topic.
26 . The method of claim 24 , further comprising:
receiving, by the processor, a command from the control plane on a commands topic of the one or more topics; and
based on a number of commands being executed exceeding a predetermined threshold, rejecting, by the processor, the command.
27 . The method of claim 24 , further comprising:
receiving, by the processor, an operation from the control plane on an operations topic of the one or more topics;
creating, by the processor, a process to execute the operation; and
publishing, by the processor, a result of the executed operation on a reply topic of the operations topic.
28 . The method of claim 27 , wherein receiving the operation from the control plane on the operations topic comprises:
polling, by the processor, an operations topic of the one or more topics for operations at regular intervals;
creating a process to execute an operation; and
publishing a result of the executed operation on a reply topic of the operations topic.
29 . The method of claim 24 , wherein publishing the request on the communication connection comprises:
publishing, by the processor, the request on a requests topic of the one or more topics.
30 . The method of claim 24 , wherein publishing the request on the communication connection comprises:
sending, by a first process running on the processor, the request to a messaging library associated with the processor; and
collecting, by a second process running on the processor, the request from the messaging library; and
publishing, by the second process, the request on a requests topic of the one or more topics.