Next Article in Journal
Machine Learning-Based Diffusion Processes for the Estimation of Stand Volume Yield and Growth Dynamics in Mixed-Age and Mixed-Species Forest Ecosystems
Previous Article in Journal
Entropy Subtraction-Supported Residual-Diffusion Framework for Image Super-Resolution
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Multi-Objective Joint Optimization for Microservice Deployment and Request Routing

Hubei Province Engineering Technology Research Center for Construction Quality Testing Equipment, College of Computer and Information Technology, China Three Gorges University, Yichang 443002, China
*
Author to whom correspondence should be addressed.
Symmetry 2026, 18(1), 195; https://doi.org/10.3390/sym18010195
Submission received: 20 December 2025 / Revised: 13 January 2026 / Accepted: 19 January 2026 / Published: 20 January 2026

Abstract

Microservice deployment and request routing can help improve server efficiency and the performance of large-scale mobile edge computing (MEC). However, the joint optimization of microservice deployment and request routing is extremely challenging, as dynamic request routing easily results in asymmetric network structures and imbalanced microservice workloads. This article proposes multi-objective joint optimization for microservice deployment and request routing based on structural symmetry. Firstly, the structural symmetry of microservice deployment and request routing is defined, including spatial symmetry and temporal symmetry. A constrained nonlinear multi-objective optimization model was constructed to jointly optimize microservice deployment and request routing, where the structural symmetric metrics take into account the flow-aware routing distance, workload balancing, and request response delay. Secondly, an improved artificial plant community algorithm is designed to search for the optimal route to achieve structural symmetry, including the environment preparation and dependency installation, service packaging and image orchestration, arrangement configuration and dependency management, deployment execution and status monitoring. Thirdly, a benchmark experiment is designed to compare with baseline algorithms. Experimental results show that the proposed algorithm can effectively optimize structural symmetry and reduce the flow-aware routing distance, workload imbalance, and request response delay, while the computational overhead is small enough to be easily deployed on resource-constrained edge computing devices.

1. Introduction

Microservice deployment (MD) and request routing (RR) are crucial in improving service quality, reducing maintenance costs, enhancing system reliability and security [1,2]. The application of microservice deployment and request routing can more efficiently process and analyze the massive data from mobile edge computing (MEC) devices, providing strong support for intelligent data processing, remote monitoring, and fault prediction [3,4]. However, microservice deployment and request routing also faced many challenges. Firstly, the microservice environment may be highly dynamic [5], such as having different types of service requests, request routing fluctuations, the diversity of user needs, unpredictable traffic spikes (e.g., flash crowds), etc. Microservice deployment and request routing must be able to adapt to these changes and maintain stable operation. Secondly, many industrial applications, such as automated control and monitoring systems, are extremely sensitive to delay [6]. Microservice deployment and request routing must provide rapid responses to ensure real-time processing of tasks. Thirdly, edge computing devices and edge servers typically have limited computing power and storage capacity.
Given the complexity of the problem, a common approach is to break it down into two sub-problems and study them separately, i.e., the microservice deployment sub-problem and the request routing sub-problem. Both sub-problems are considered NP-hard by existing research, though the models used by different scholars vary greatly, such as a mixed-integer nonlinear program (MINLP) [1], or an integer nonlinear program (INLP) [3]. The authors of [7] considered the problem of microservice latency optimization as an NP-hard mathematical optimization problem and provided a fine-tuned Large Language Model (LLM) to solve it. The authors of [8] insisted that the cost optimization of microservice deployment is a statistical NP-hard problem and employed a revised machine learning (ML) algorithm to make decisions regarding task offloading. The authors of [9] reviewed a total of 239 related works and selected 38 of them to identify three types of deployment approaches and seven different communication patterns, where eight deployment challenges and six communication challenges were identified. The communication patterns of microservices may impact the sub-problem of request routing.
Considering that traditional algorithms struggle to solve such NP-hard problems, various artificial intelligence (AI) algorithms have been introduced to help us solve them. The authors of [3] proposed a fine-grained reinforcement learning (RL)-based algorithm, and the authors of [5] put forward a deep reinforcement learning (DRL) algorithm based on reward shaping. The authors of [10] treated the microservice placement problem as fuzzy graph clustering followed by heuristic packing, and the authors of [11] introduced a graph deep learning (DL) model to meet various quality of service (QoS) requirements. Among them, various heuristic algorithms, with their simple computation and strong universality, have also been used to solve microservice deployment problems. The authors of [12] introduced a non-dominated sorting genetic algorithm (NSGA-III) to seek the optimal deployment strategy of microservice instances in various resource centers, and the authors of [13] presented a particle swarm optimization (PSO) algorithm to solve the multi-objective optimization problem of container-based microservice scheduling. In addition, there are ant colony optimization (ACO) [14], gray wolf optimizer (GWO) [15], greedy algorithm [15], and whale optimization algorithm (WOA) [16], which have also been proven to be effective.
The above research did not effectively integrate microservice deployment and request routing issues as a whole and consider the structural symmetry between the two. In order to complete the fast solution on the resource-limited edge computing platform, we improved the artificial plant community (APC) algorithm in [17]. Our contributions are as follows.
Firstly, the structural symmetry of microservice deployment is defined, including spatial symmetry and temporal symmetry. A constrained nonlinear multi-objective optimization (MOO) model was constructed to jointly optimize microservice deployment and request routing, systematically considering the structural symmetric metrics, i.e., the flow-aware routing distance, workload balancing, and request response delay. Various deployment factors are considered, which are very complex and interact with each other, forming extremely challenging constraints.
Secondly, considering the NP-hard nature of this problem, an improved artificial plant community algorithm is designed to search for the optimal route to achieve structural symmetry. It includes the environment preparation and dependency installation, service packaging and image orchestration, arrangement configuration and dependency management, deployment execution and status monitoring. The global and local search capabilities of the proposed algorithm are enhanced, and the computing process is simplified for deployment on edge computing devices.
Thirdly, a benchmark experiment is designed to compare with baseline algorithms. Experimental results show that the proposed algorithm can effectively reduce the flow-aware routing distance, workload balancing, and request response delay, while the computational overhead is small enough to be easily deployed on resource-constrained edge computing devices.
The article is structured as follows: Section 2 reviews related work. Section 3 introduces the multi-objective optimization model, and Section 4 describes an APC-based solution mechanism. Section 5 illustrates a benchmark test set and a set of benchmark experiments. Section 6 concludes the article and points out the next research work.

2. Related Work

With the continuous advancement of the microservices, the number of mobile edge computing devices has risen sharply, leading to an astonishing rate of data growth [2]. Microservice deployment and request routing, by decentralizing computing power to the network’s edge, not only alleviates the pressure on the cloud computing center but also significantly reduces the cost of data transmission and data response time [3]. In microservice deployment and request routing, there are also significant challenges.
The first major challenge in microservice deployment and request routing is dynamic service requirements. In the microservice environment, service requirements are constantly changing, and some edge computing services have higher requirements for real-time performance. The authors of [12] considered the computation and storage resource utilization rate, load balancing rate, and actual microservice usage rate in resource service centers. The authors of [13] took into account the network transmission overhead, ineffective load balancing, and low service reliability. The authors of [18] aimed at minimizing both system communication overhead and microservice deployment cost, and the authors of [19] minimized the execution cost and communication costs among the microservices. The authors of [20] improved the secure and efficient placement of microservices in a larger attack environment. The authors of [21] developed a multi-channel directed graph convolutional network model to capture the spatial dynamics of edge device distribution and jointly considered the heterogeneity of the edge devices and the links between them.
The second major challenge is that many microservice applications are latency sensitive. The authors of [3] introduced delay-aware optimization of fine-grained microservice deployment and routing in the edge via reinforcement learning. The authors of [5] proposed a reinforcement learning algorithm based on reward shaping to minimize user waiting delay and edge network resource consumption. The authors of [15] aimed at minimizing users’ latency and maximizing edge providers’ profits. The authors of [22] formulated the microservice deployment problem in satellite edge computing networks as a partially observable Markov decision process (POMDP) to minimize the workload imbalance and the service latency. Due to the potential hardware breakdowns, each edge server’s failures may affect its lifetime, i.e., the time length to work continuously without interruptions, and in turn lead to the microservice collapse or the request latency. The authors of [23] considered dynamic task generations and the asynchronization of various decision variables with different microservices and designed an online optimization algorithm integrating randomized rounding, Lagrangian method, and convex optimization, to iteratively solve the microservice deployment problem over different timescales.
The third major challenge is that the edge computing devices deployed with microservices often have limited computing power and energy. Due to the limited CPU and storage resources in edge computing devices, the coarse-grained service deployment on edge devices easily leads to performance bottlenecks. The authors of [5] illustrated a heuristic algorithm to scale microservice instances horizontally in dynamic user request states with less edge network resource consumption. The authors of [24] designed a microservice deep-learning edge detection framework for easy deployment and distributed processing in edge computing environments. The authors of [25] present a microservice architecture to provide multi-user cloud virtual reality and an efficient deployment scheme in edge computing networks. The authors of [26] defined the service placement problem in microservice systems as a fractional polynomial problem to achieve rapid development and continuous delivery in a highly distributed edge computing environment. The authors of [27] exploited a hybrid particle swarm optimization method to solve the microservice-based SaaS deployment problem and reduce the increase in energy consumption.
To address the above challenges, AI algorithms represented by deep learning and heuristic learning are widely used. Deep learning is based on multi-layer neural networks, which automatically extract features from training data and pursue data-driven accurate prediction, such as the DL [3,24], RL [3,20], DRL [5,21,22,28], ML [8], graph deep learning [11], distributed multi-agent reinforcement learning (DMARL) [22], graph neural networks [29], deep Q learning [30], etc. It requires a large amount of data support, and the objective function is usually differentiable. It is suitable for complex data pattern recognition and fields that require high-precision prediction. However, heuristic learning relies on heuristic functions to evaluate states, focusing on quickly finding feasible solutions through empirical strategies without strict guarantees on solution quality, such as genetic algorithm (GA) [4,12], PSO [13,27], ACO [14], GWO [15], greedy algorithm [15,26], WOA [16], APC algorithm [17,31], adaptive crested porcupine optimizer (ACPO) algorithm [18], sand cat swarm optimization [32], etc. It is suitable for NP-hard problems or time-sensitive problems with large solution spaces.
Therefore, existing research in recent years continues to pay attention to the optimization challenges in microservice deployment and request routing. However, there are still research gaps. Firstly, most research work has not effectively integrated microservice deployment and request routing, making it challenging to analyze the correlation between the dynamic request routing, asymmetric network structures, and imbalanced microservice workloads. Second, given that both sub-problems are NP-hard, their joint optimization is also NP-hard. It is very challenging to design efficient algorithms to solve such NP-hard problems on the edge computing platform. Thirdly, there is a lack of suitable benchmark datasets for baseline algorithm comparison or for deep learning algorithm training. The research motivation of this manuscript is to attempt to fill these research gaps.

3. Materials and Methods

This paper first uses an example to achieve microservice deployment and request routing in an edge computing manner. The microservice deployment and request routing are integrated in a constrained nonlinear multi-objective optimization model to achieve structural symmetry and joint optimization. It defines the flow-aware routing distance, workload balancing, and request response delay, enabling the microservice system to dynamically adjust its behavior according to real-time use requests.

3.1. Symbol Definition

The example for microservice deployment and request routing is shown in Figure 1, which includes the remote cloud to remotely access computing resources in the cloud, sensor nodes for data collection, the edge computing devices for data access, and the edge servers for data processing. Container technology, such as Docker, packages applications and all their dependencies into lightweight, portable containers to ensure consistent service performance across different environments, providing an ideal runtime environment for microservices. Figure 1 employs a decentralized architecture for microservice deployment and request routing on the edge servers. The sensor nodes and the edge computing devices communicate through wireless channels, while the edge server is connected to the remote cloud via wired links. Asymmetric structure can easily lead to workload imbalance among server clusters with different geographical locations and network structures, resulting in excessive local data traffic and network overload.
In the microservice system, there is a set of microservices, M = { 1 , 2 , , m , , m m a x } , and a set of edge servers, S = { 1 , 2 , , s , , s m a x } , where C s c o m p and C s s t o r represent the computing capacity and storage capacity of edge server s , respectively. There are microservice deployments that operate in discrete time slots T = { 1 , 2 , , , t , , t m a x } , where T represents a finite time horizon. Compared to the limited storage and computing resources of edge servers, it is assumed that the remote cloud has sufficient computing and storage capacity and can complete all microservice requests in time. For request routing, R m c o m p (in CPU cycles) represents the computing resource required to process microservice m , and R m s t o r (in bits) is the storage capacity required to place microservice m . This ratio, γ s , m c o m p ( t ) , is a number between 0 and 1 that represents how computing resources in edge server s are shared among different microservices.
Definition 1.
Structural symmetry refers to maintaining the local similarity and periodicity of the network structure during microservice deployment and request routing, including spatial and temporal symmetry. Spatial symmetry refers to maintaining the visual and topological symmetry of the network structure during microservice deployment and request routing, including the local similarity of nodes and request routing in microservice deployment. Temporal symmetry refers to the periodicity of similar businesses and functions before and after microservice deployment and request routing.
Unlike traditional metrics such as network centrality, the proposed definition attempts to measure the structural symmetry of microservice deployment and request routing from both spatial and temporal dimensions.
The example in Figure 1 describes the process of microservice deployment and request routing, based on which a constrained nonlinear multi-objective optimization model is built in the following section. For clarity, the main symbols used in our multi-objective optimization model are shown in Table 1.

3.2. A Constrained Nonlinear Multi-Objective Optimization Model

3.2.1. The Flow-Aware Routing Distance

According to Definition 1, the primary objective is to evaluate spatial symmetry, which means maintaining the image symmetry and topological symmetry of the network structure during microservice deployment, including the local similarity of nodes and request routing in microservice deployment. Here we consider a flow-aware routing distance metric weighting by actual request flows or traffic volumes.
A binary variable γ s , m ( t ) is defined to indicate whether microservice m is deployed on the edge device or edge server s at time slot t . If microservice m is deployed on edge server s , it is set as γ s , m ( t ) = 1 ; otherwise, γ s , m ( t ) = 0 . A decision variable is defined in Equation (1) for microservice deployment.
x M ( t ) = { γ s , m ( t ) | s S , m M }
As the task must be implemented, microservice m not deployed on the edge server will be processed by core network c . There is
s = 1 S c γ s , m ( t ) = 1 , m , t .
It is assumed that there are two edge servers s and s with coordinates s ( x s , y s ) and s ( x s , y s ) , and the actual request flows or traffic volumes between them are described as a weight, w s s ; so the flow-aware routing distance between them can be calculated as a nonlinear constraint in Equation (3).
d s s = w s s ( x s x s ) 2 + ( y s y s ) 2
The first objective of the joint optimization of microservice deployment and request routing is to minimize the flow-aware routing distance, which reflects the structural symmetry of microservice deployment, such as unpredictable traffic spikes or flash crowds. According to Equation (3), the minimization of the total flow-aware routing distance can be calculated as follows:
o b j 1 = m i n { s , s d s s | s , s S } .

3.2.2. The Workload Balancing

According to Definition 1, temporal symmetry is also an important feature of structural symmetry, indicating the similarity of businesses and functions before and after maintaining route changes during microservice deployment.
The total flow-aware routing distance in Equation (4) describes the structural symmetry of microservice deployment from a static routing perspective, while the workload balancing in the second objective determines the structural symmetry from a dynamic routing perspective. In dynamic routing, all microservice scheduling strategies are defined as
x R ( t ) = { γ s , m c o m p ( t ) L s , m ( t ) | s S , m M } ,
where L s , m ( t ) represents the proportion of edge computing power C s c o m p allocated to microservice m , so the higher the value, the more computing resources are allocated.
The fraction of computing capacity for microservice m is allocated by the edge device or edge server s at time slot t .
γ s , m c o m p ( t ) [ 0 , 1 ] ,     m , t
Workload ratio can be calculated as L s , m ( t ) , where microservice m is operated on edge server s at time slot t .
L s , m ( t ) [ 0 , 1 ] , m , t
At time slot t , the total number of requests for microservice m in the microservice can be obtained as
m m r e q u ( t ) = s = 1 S m s , m r e q u ( t ) , m , t
Based on the microservice layout and scheduling strategy in Equations (6)–(8), the total computing capacity R s , m c o m p ( t ) and total storage capacity R s , m s t o r ( t ) running on the edge server s can be expressed as follows:
R s , m c o m p ( t ) = γ s , m c o m p ( t ) L s , m ( t ) R m c o m p m m r e q u ( t )
R s , m s t o r ( t ) = γ s , m c o m p ( t ) L s , m ( t ) R m s t o r m s , m r e q u ( t )
We note that if R s , m c o m p ( t ) C s c o m p γ s , m c o m p ( t ) , the actual allocated resources are higher than the theoretical required resources, then the computational workload required for microservice m comes from the edge server s ; otherwise, the surplus workload ( R s , m c o m p ( t ) C s c o m p γ s , m c o m p ( t ) ) corresponds to the nearby edge servers. Hence, the proposed system can cope with sudden and unpredictable spikes, such as traffic spikes.
The second objective of the joint optimization of microservice deployment and request routing is to minimize the workload balancing, which reflects the difference between the maximum workload and the minimum workload. According to Equations (9) and (10), the minimization of the workload balancing can be calculated as follows:
o b j 2 = { min { max s , m R s , m c o m p ( t ) min s , m R s , m c o m p ( t ) max s , m R s , m c o m p ( t ) } , m i n { max s , m R s , m s t o r ( t ) min s , m R s , m s t o r ( t ) max s , m R s , m s t o r ( t ) } } .
The workload balancing objective adopts the max–min normalization method between servers and microservices, which is very sensitive to extremely heavy and light workloads, and only requires two parameters with low computational overhead. On lightweight computing platforms, it may be faster and more energy-efficient than variance- or entropy-based balancing methods.

3.2.3. The Request Response Delay

According to Definition 1, temporal symmetry also includes maintaining similar functionality before and after routing changes and exhibiting periodicity in time during microservice deployment.
The first objective in Equation (4) and the second objective in Equation (11) describe the structural symmetry of microservice deployment from a global perspective, while the request response delay in the third objective measures the structural symmetry from a local perspective. Due to the different locations of edge servers in the network, the request response delay will also vary, even if the total flow-aware routing distance and workload balancing are similar. The microservice response delay mainly consists of two parts: the computational delay and transmission delay.
The computational delay refers to the time required to complete a certain amount of workload on an edge device, which is related to the computing power of the device. The computational delay for processing microservice m on the edge server s can be represented as the ratio of the required workload to the allocated computing capacity. At the same time, the computational delay is also affected by the proportion of computing capacity γ s , m c o m p ( t ) allocated to the microservice m , because even if microservice m is allocated to a certain edge server, if the computing capacity allocated to it is very small, then the computational delay will also be very high. Regarding the computational delay, since the computing capacity of the cloud is relatively large, only the computational delay of data on the edge server is considered. The computational delay d s , m c o m p ( t ) for microservice m processed on edge server s can be obtained as
d s , m c o m p ( t ) = γ s , m ( t ) R s , m c o m p ( t ) γ s , m c o m p ( t ) C s c o m p .
The transmission delay refers to the time required for transmission between two devices, which is related to the location of the device in the network. It contains the transmission delay of data between the edge server and the cloud, the transmission delay of data being transported to the cloud, and the transmission delay or wireless delay between sensing devices and edge servers. It is considered that there are multiple adjacent edge servers with a transmission rate of r e d g e t r a n ( t ) , and the transmission delay between sensing devices and edge servers is d s e n s t r a n ( t ) ; the transmission delay d s , m t r a n ( t ) of the edge server can be obtained as follows:
d s , m t r a n ( t ) = γ s , m ( t ) r e d g e t r a n ( t ) max { ( R s , m c o m p ( t ) C s c o m p γ s , m c o m p ( t ) ) , 0 } + d s e n s t r a n ( t ) .
Equation (13) includes two parts, where the first part is the transmission delay of data between the edge server and the cloud or the transmission delay of data being transported to the cloud, and the second part is the transmission delay between sensing devices and edge servers. When R s , m c o m p ( t ) C s c o m p γ s , m c o m p ( t ) , it indicates that microservice m is running on multiple edge servers. Therefore, the transmission delay between edge servers is the net data volume divided by the transmission rate.
The transmission rate of the core network for microservice m at time slot t is defined as r m t r a n ( t ) , so the cloud processing delay d c , m p r o c ( t ) can be expressed as:
d c , m p r o c ( t ) = 1 r c , m t r a n ( t ) ( 1 s = 1 S γ s , m ( t ) ) ( 1 s = 1 S L s , m ( t ) ) s = 1 S R s , m c o m p ( t ) .
The processing delay for outsourcing to the core network is determined by the ratio of the total data volume to be transmitted and the transmission rate. In Equation (14), the two parts, 1 s = 1 S γ s , m ( t ) and 1 s = 1 S L s , m ( t ) , constrain microservice m to be processed, that is, microservice m at time slot t is either processed in the edge server s or outsourced to the remote cloud.
Considering the computational delay d s , m c o m p ( t ) in Equation (12), the transmission delay d s , m t r a n ( t ) in Equation (13), and the cloud processing delay d c , m p r o c ( t ) in Equation (14), the average response delay for microservice m can be obtained as follows:
d m a v g ( t ) = s = 1 S ( d s , m c o m p ( t ) + d s , m t r a n ( t ) ) + d c , m p r o c ( t ) .
In the text, d m a v g ( t ) refers to the average value of the total response delay for microservice m , which includes three parts of delays. As the processing at the remote cloud usually involves longer transmission delays, it is important to reduce the outsourcing of microservices to the remote cloud. Therefore, an outsourcing penalty term β is introduced, which is directly proportional to the outsourcing volume and the penalty coefficient R m c o m p for the outsourced microservice. This penalty term reflects the impact of the outsourced microservice on the total response delay and encourages the algorithm to process as many microservice as possible on the edge server to reduce delay.
Hence, the request response delay we propose takes into account the delay of both the request and response processes, rather than just minimizing the delay. According to the average response delay in Equation (15), the third objective is to minimize the request response delay, so the corresponding optimization objective can be expressed as follows:
o b j 3 = m i n { d m a v g ( t ) + β ( 1 s = 1 S γ s , m ( t ) ) ( 1 s = 1 S L s , m ( t ) ) s = 1 S R s , m c o m p ( t ) R m c o m p }
From the perspective of ease of calculation, outsourcing penalty term β can be quickly determined by user delay requirements and network size. The higher the user’s delay requirements and the larger the network size, the higher the β value, and more effort is needed to reduce this objective.
Therefore, the solution is to search for the optimal microservice deployment strategies, which are defined as
x M ( t ) = { ( γ s , m ( t ) | ( γ s , m ( t ) = 0   o r   1 , s S , m M } .
Each edge server s has two choices for each service m : to provide ( γ s , m ( t ) = 1 ) or not to provide ( γ s , m ( t ) = 0 ). Therefore, for a single edge server and all M microservices, there are 2 M possible placement combinations. However, since there are S edge servers, and each edge server can independently decide its microservice deployment, the strategy space for the entire system is the product of each edge servers, 2 M S , that is, the strategy space for microservice deployment is 2 M for each edge server S .
Then, the nonlinear multi-objective optimization model to jointly optimize microservice deployment and request routing can be obtained by the first objective (the flow-aware routing distance) in Equation (4), the second objective (the workload balancing) in Equation (11), and the third objective (the request response delay) in Equation (16).
o b j = { o b j 1 , o b j 2 , o b j 3 }

3.2.4. The Constraints

Section 3.2.1, Section 3.2.2 and Section 3.2.3 describe how to minimize the flow-aware routing distance, the workload balancing, and the request response delay of microservice deployment and request routing without considering the constraints. However, in microservice environments, various factors are very complex and interact with each other, forming extremely challenging constraints.
Constraint 1.
Since the computing capacity on the edge device or edge server is limited, the fraction of computing capacity for microservice  m  allocated by edge server  s  at time slot  t  cannot exceedthe maximum value of 1, that is,
m = 1 M γ s , m c o m p ( t ) 1 , s , t
Constraint 2.
Due to the limited computing capacity on the edge device or edge server, the size of the computing resources allocated to microservice  m  cannot exceed its maximum, that is,
m = 1 M γ s , m ( t ) R m c o m p C s c o m p , s , t .
Constraint 3.
Similarly, due to the limited storage capacity on the edge device or edge server, the size of the storage resources allocated to microservice  m  cannot exceed its maximum, that is,
m = 1 M γ s , m ( t ) R m s t o r C s s t o r , s , t
Constraint 4.
As the task must be performed, so microservice  m not deployed on edge servers will be processed by core network.
s = 1 S c L s , m ( t ) = 1 , m
Constraint 5.
The L s , m ( t ) indicates the workload ratio of microservice m running on the edge server s at time slot t , and the number of requests for microservice m on edge server s at time slot t is m s , m r e q u ( t ) .
L ( t ) = { L s , m ( t ) | s S , m M } .
Constraint 6.
The state space represents the set of all states, including the number of requests for each microservice m s , m r e q u ( t ) , the current optimal resource allocation strategy γ s , m ( t ) , the computing resources C s c o m p of edge server s , and the storage resources C s s t o r of edge server s .
u s ( t ) = { m s , m r e q u ( t ) , C s c o m p , C s s t o r , γ s , m * ( t ) } > { 0 }
Constraint 7.
The request routing L s , m ( t ) indicate the workload ratio of microservice m running on the edge server s at time slot t . L s , m ( t ) is a continuous value, so it needs to be discretized. Here, L s , m ( t ) is evenly divided and each part is L s , m ( t ) , thus the load scheduling decision L s , m ( t ) can be expressed as follows:
L s , m ( t ) { L s , m ( t ) , , m L s , m ( t ) , , 1 }
Constraint 8.
The action space represents the collection of all actions, mainly including microservice deployment strategies and request routing strategies. Therefore, the action space v s ( t ) of the edge server s at time slot t is expressed as follows:
v s ( t ) = { m M , s S , γ s , m ( t ) { 0 , 1 } , L s , m ( t ) {   L s , m ( t ) , , m L s , m ( t ) , , 1 } }
Constraint 9.
The reward function is used to evaluate the immediate reward from flow-aware routing distance for taking a certain action in a given situation. Therefore, we can define the reward function as
F ( t ) = m = 1 M d m a v g ( t ) < 0
Constraint 10.
The reward probability function is used to describe the reward value of the new state reached after taking action  v s ( t )  from the given state u s ( t ) , such as unpredictable traffic spikes or flash crowds.
Q ( u , v ) = E ( t = 1 T α t F ( t + 1 ) | u s ( t ) = u s ( t + 1 ) , v s ( t ) ) > 0
where E [   ] is the expectation with respect to the time-varying system environment, that is, the weighted average of all possible future states and rewards. The time step starts from 1 to T . F ( t + 1 ) represents the immediate reward obtained when u s ( t ) transitioning to a new state u s ( t + 1 ) after taking an action v s ( t ) in the current state.
Constraint 11.
The microservice deployment  γ s , m ( t ) indicate whether microservice m is deployed on the edge server s at time slot t , assuming there are S edge servers and M microservices.
γ s , m ( t ) { 0 , 1 }

4. APC-Based Solution Mechanism

Considering the NP-hard nature of this problem, an improved artificial plant community algorithm is designed to search for the optimal route to achieve structural symmetry. The proposed solution mechanism is improved from the APC approach through enhancing its search ability and reducing its computational overhead.

4.1. An Improved APC Approach

The improved APC approach for joint optimization of microservice deployment and request routing employs simpler calculation steps and fewer parameters to achieve lightweight computation. The primary operations of the improved APC approach include seeding, growing, and fruiting. Hence, an artificial plant individual can be presented in three forms, i.e., a seed, an individual, and a fruit. Through three main operations, each individual form can have a certain probability of transitioning to another form or dying until the APC population gathers near the optimal solution.
The APC-based solution mechanism comprises four main steps, i.e., environment preparation and dependency installation, service packaging and image orchestration, arrangement configuration and dependency management, deployment execution and status monitoring.
Step 1: Environment preparation and dependency installation. Before deployment, it is necessary to ensure that the target environment has installed the container, such as the local development machine or server.
Step 2: Service packaging and image orchestration. Each microservice needs to package files through tools, write and define image orchestration for each service, and build context.
It is the first step of the improved APC approach to initialize the whole solution system, such as the main parameters of the problem to be solved and the APC approach.
The main parameters of the problem to be solved include a set of microservices, M = { 1 , 2 , , m , , m m a x } , a set of edge servers, S = { 1 , 2 , , s , , s m a x } , the position of edge servers s with coordinates s ( x s , y s ) , the computing capacity ( C s c o m p ) and storage capacity ( C s s t o r ) of edge server s , a discrete time slot set T = { 1 , 2 , , , t , , t m a x } , R m c o m p (in CPU cycles) for the computing resource required to process microservice m , R m s t o r (in bits) for the storage capacity required to place microservice m , the reward function of F ( t ) at time slot t , the discount factor of α to diminish the influence of future rewards on present decision-making, and the probability of β that microservice m is outsourced to the remote cloud at time slot t .
The initialization parameters for an APC approach include the population size P , the seeding probability p s e e d , the growing probability p g r o w , and the fruiting probability p f r u i t . An artificial plant individual is encoded as x M ( t ) = { γ s , m ( t ) | s S , m M } in Equation (1). The fitness function f i t of APC can select the nonlinear multi-objective optimization model to jointly optimize microservice deployment and request routing in Equation (18).
f i t = o b j
The constraints include Equations (19)–(29).
Step 3: Arrangement configuration and dependency management. Use containers to define dependencies, networks, and resource allocation between services. This step will list all services (such as databases, gateways, business services) and associate them with images, port mappings, environment variables, and dependencies (such as depending on to ensure service startup order). It will then create custom networks to enable communication between services through service names, and mount persistent data volumes, such as database storage directories.
Step 3-1: Seeding. In the first iteration k = 0 , a group of random APC seeds is produced with a population size of P , which means that there is no fruit and all seeds { x s e e d r a n d ( k ) } are randomly produced. The population size of seeds is P .
{ x s e e d ( k = 0 ) } P = { x s e e d r a n d ( k ) } P = r a n d { γ s , m ( t ) | s S , m M } P .
In subsequent iterations k > 0 , the seeding probability p s e e d [ 0 , 1 ] determines the global search ability of the APC, which helps prevent the risk of the algorithm falling into local optima. The seed population { x s e e d ( k ) } includes two parts: the random seeds { x s e e d r a n d ( k ) } for global search with a probability p s e e d , and the fruits { x s e e d f r u i t ( k 1 ) } in the previous iteration with a probability ( 1 p s e e d ) .
{ x s e e d ( k > 0 ) } P = { x s e e d r a n d ( k ) p s e e d , x s e e d f r u i t ( k 1 ) ( 1 p s e e d ) } P .
Step 3-2: Growing. In the growing step, it is to provide the fittest comparison and selection for the seed population through the fitness function f i t in Equation (30). Only the optimal seeds { x s e e d ( k ) } will be selected to grow with a growing probability p g r o w [ 0 , 1 ] . Seeds with lower fitness will die, so the population size of the growing individuals { x g r o w ( k ) } will decrease to P p g r o w . The growing step improves the convergence ability of the APC approach to provide any convergence guarantees or bounds on solution quality for the NP-hard multi-objective optimization problem.
{ x g r o w ( k ) } P p g r o w = { x s e e d ( k ) | max P p grow f i t ( x s e e d ( k ) ) } P p g r o w .
Step 3-3: Fruiting. The fruiting step provides the growing individuals { x g r o w ( k ) } with more opprtunities to produce more solutions { x f r u i t ( k ) } , so as to strengthen the local search ability of the APC approach. The fruit population { x f r u i t ( k ) } includes two parts: the parthenogenesis of the parent { x g r o w ( k ) } for optimal solution preservation with a probability of p s e e d , and the crossing fruits { x f r u i t c r o s s ( k ) } of the parent for local search with a population size of P p g r o w .
{ x f r u i t ( k ) } 2 P p g r o w = { { x g r o w ( k ) } P p g r o w , { x f r u i t c r o s s ( k ) } P p g r o w }
Therefore, the total population size of the fruits has doubled, where better individuals may have more fruiting opportunities.
The crossing fruit is determined by a fruiting probability p f r u i t [ 0 , 1 ] , which indicates how much original information a parent can retain. Assuming there are two parents, x g r o w a ( k ) and x g r o w b ( k ) , so two possible fruits can be produced as follows:
{ x f r u i t c r o s s ( k ) = { x g r o w a ( k ) p f r u i t / / x g r o w b ( k ) 1 p f r u i t } x f r u i t c r o s s ( k ) = { x g r o w b ( k ) p f r u i t / / x g r o w a ( k ) 1 p f r u i t } .
where ‘//’ denotes the concatenation of two strings.
Step 3-4: End Justification. The end justification may establish a percentage error threshold e t h according to the fitness function f i t in Equation (30), the maximum number of iterations k m a x , or the maximum solving period T m a x . If any of the end conditions are met, the APC approach will terminate the iterative calculation and output the optimal solution x M ( t ) . Otherwise, the fruits will be returned to Step 2 for the next iterative calculation until the end justification is fit.
Step 4: Deployment execution and status monitoring. These are to deploy microservices and request routing according to the optimal solution in step 3, start all services in the background, check service status, and view logs to troubleshoot issues.

4.2. The Flowchart

The flowchart of the APC-based solution mechanism is shown in Figure 2, where there are four main steps and a big loop to solve the joint optimization of microservice deployment and request routing. After environment preparation and dependency installation, service packaging and image orchestration, arrangement configuration and dependency management, deployment execution and status monitoring, the application will be constructed as a set of loosely coupled microservices. Figure 2 indicates only a large computational loop, where the APC will return and continue the next round of iterative calculations. In each loop, any APC individual can be calculated based on the population size, P , and each solution is encoded based on Equation (1) for joint optimization of microservice deployment and request routing. Since the loop in Figure 2 depends on the number of iterations, k m a x , the computational complexity of the improved APC approach is O ( m m a x × k m a x × P ) , where m m a x is the number of microservices, k m a x is the maximum number of iterations, and   P is the population size.

4.3. The Pseudo-Code

For the challenges in joint optimization of microservice deployment and request routing, the pseudo-code is listed in Algorithm 1, which is based on the improved APC approach in Section 4.1. The proposed pseudo-code decreases computational complexity and makes it easier to be deployed on an edge server for fast calculation.
In Algorithm 1, the inputs include a set of microservices, M = { 1 , 2 , , m , , m m a x } , a set of edge servers, S = { 1 , 2 , , s , , s m a x } , the position of edge servers s with coordinates s ( x s , y s ) , the actual request flows or traffic volumes between edge servers ( w s s ), the computing capacity ( C s c o m p ) and storage capacity ( C s s t o r ) of edge server s , a discrete time slot set T = { 1 , 2 , , , t , , t m a x } , R m c o m p (in CPU cycles) for the computing resource required to process microservice m , R m s t o r (in bits) for the storage capacity required to place microservice m , the reward function of F ( t ) at time slot t , the discount factor of α to diminish the influence of future rewards on present decision-making, and the probability of β that microservice m is outsourced to the remote cloud.
The constraints meet all the requirements in Section 3.2.4, including Constraint 1 in Equation (19), Constraint 2 in Equation (20), Constraint 3 in Equation (21), Constraint 4 in Equation (22), Constraint 5 in Equation (23), Constraint 6 in Equation (24), Constraint 7 in Equation (25), Constraint 8 in Equation (26), Constraint 9 in Equation (27), Constraint 10 in Equation (28), and Constraint 11 in Equation (29).
The initialization parameters for an APC approach include the population size P , the seeding probability p s e e d , the growing probability p g r o w , and the fruiting probability p f r u i t . The fitness function f i t of APC can select the nonlinear multi-objective optimization model in Equation (30).
In the optimal solution x M ( t ) = { ( γ s , m ( t ) | ( γ s , m ( t ) = 0   o r   1 , s S , m M } , γ s , m ( t ) indicates each edge server s has two choices for each service m , where γ s , m ( t ) = 1 signifies that microservice m is deployed on edge server s , and γ s , m ( t ) = 0 indicates microservice m is not deployed on edge server s . Algorithm 1 will search for x M ( t ) = { ( γ s , m ( t ) | ( γ s , m ( t ) = 0   o r   1 , s S , m M } to optimize structural symmetry and reduce the flow-aware routing distance, workload balancing, and request response delay.
Algorithm 1. APC-based microservice deployment and request routing algorithm
Input: M = { 1 , 2 , , m , , m m a x } , S = { 1 , 2 , , s , , s m a x } , { s ( x s , y s ) } , { w s s }, { C s c o m p } , { C s s t o r } , T = { 1 , 2 , , , t , , t m a x } , { R m c o m p } , { R m s t o r } , F ( t ) ,   α , and   β .
Constraints: Equations (19)–(29)
Set: P , p s e e d , p g r o w , p f r u i t , and f i t .
Output: The optimal solution x M ( t ) = { γ s , m ( t ) | s S , m M } .
1:
Environment preparation and dependency installation
2:
Service packaging and image orchestration
3:
d s s = w s s ( x s x s ) 2 + ( y s y s ) 2
4:
{ x s e e d ( k = 0 ) } P = { x s e e d r a n d ( k ) } P = r a n d { γ s , m ( t ) | s S , m M } P
5:
Arrangement configuration and dependency management
6:
for k = 1 : k m a x
7:
    m m r e q u ( t ) = s = 1 S m s , m r e q u ( t ) , m , t
8:
    R s , m c o m p ( t ) = γ s , m c o m p ( t ) L s , m ( t ) R m c o m p m m r e q u ( t )
9:
    R s , m s t o r ( t ) = γ s , m c o m p ( t ) L s , m ( t ) R m s t o r m s , m r e q u ( t )
10:
   d m a v g ( t ) = s = 1 S ( d s , m c o m p ( t ) + d s , m t r a n ( t ) ) + d c , m p r o c ( t )
11:
   { x s e e d ( k > 0 ) } P = { x s e e d r a n d ( k ) p s e e d , x s e e d f r u i t ( k 1 ) ( 1 p s e e d ) } P
12:
   o b j 1 = m i n { 1 s , m γ s , m ( t ) s , s d s s }
13:
   o b j 2 = { min { max s , m   R s , m c o m p ( t ) min s , m   R s , m c o m p ( t ) } , m i n   { max s , m   R s , m s t o r ( t ) min s , m   R s , m s t o r ( t ) } }
14:
   o b j 3 = m i n { d m a v g ( t ) + β ( 1 s = 1 S γ s , m ( t ) ) ( 1 s = 1 S L s , m ( t ) ) s = 1 S R s , m c o m p ( t ) R m c o m p }
15:
   f i t = o b j = { o b j 1 , o b j 2 , o b j 3 }
16:
   { x g r o w ( k ) } P p g r o w = { x s e e d ( k ) |   max P p grow   f i t ( x s e e d ( k ) ) } P p g r o w
17:
   x f r u i t c r o s s ( k ) = { x g r o w a ( k ) p f r u i t / / x g r o w b ( k ) 1 p f r u i t }
18:
   { x f r u i t ( k ) } 2 P p g r o w = { { x g r o w ( k ) } P p g r o w , { x f r u i t c r o s s ( k ) } P p g r o w }
19:
   x * ( k ) = { γ s , m ( t ) | m a x   { f i t ( x ( k ) ) } }
20:
  if | f i t ( x ( k ) f i t ( x ( k 1 ) | e t h then return to line 7
21:
end for
22:
Output the optimal solution x M ( t )
23:
Deployment execution and status monitoring
In Algorithm 1, the end justification in line 20 is established by a percentage error threshold e t h through the fitness function f i t in Equation (30), which can be replaced by other ending conditions, i.e., the maximum number of iterations k m a x or the maximum solving period T m a x . The computational complexity of Algorithm 1 can be determined by the number of microservices ( m m a x ), the population size ( P ), and the maximum number of iterations ( k m a x ), i.e., O ( m m a x × k m a x × P ) .

5. Benchmark Test

This section develops a benchmark dataset and conducts a set of benchmark experiments to validate and compare our proposed method and some baseline algorithms.

5.1. Benchmark Dataset

The benchmark map with 100 edge devices is shown in Figure 3, where all edge devices are randomly generated as edge servers. In the benchmark map, the entire testing area was divided into a 1 km × 1 km square, and a large number of microservice requests were randomly distributed. Our task is to jointly optimize microservice deployment and request routing, systematically considering the structural symmetric metrics, i.e., the flow-aware routing distance, workload balancing, and request response delay.
According to Figure 3, the benchmark dataset and configuration for jointly optimizing microservice deployment and request routing are shown in Table 2. In the benchmark test, all tested algorithms should search for the optimal microservice placement location and device connection based on Table 2. Microservices should be deployed near access nodes, which helps to reduce network delay and improve data transmission efficiency. Request nodes should connect to the nearest edge server through access routes, ensuring that all nodes can quickly access microservice resources.
The benchmark experiments were run on an AMD A6-9225 RADEON R4, a 2.60 GHz CPU, 4.00 GB of RAM, a 64-bit Windows 10 operating system, and MATLAB R2021b simulation software.

5.2. Experimental Results

The solutions of the APC-based microservice deployment and request routing algorithm on 100 edge devices are depicted in Figure 4a–l, and they are conducted by Algorithm 1. In the APC algorithm, the parameters were set as follows: the seeding probability p s e e d = 0.2 , the growing probability p g r o w = 0.4 , the fruiting probability p f r u i t = 0.7 , and the population size of APC is set to P = 200 . When microservice requirements undergo dynamic changes, the proposed APC algorithm can quickly divide large and complex system functions into a series of small, independent microservices based on dynamic requirements, which can be deployed, run, and expanded independently to meet the constantly changing microservice requirements. At the same time, the proposed APC approach can efficiently search for the optimal route to edge server s and achieve structural symmetry, i.e., the flow-aware routing distance, workload balancing, and request response delay.
In Figure 4a–l, when microservice requests change, although the edge device position remains fixed, there is a significant change in routing, resulting in a change in edge server s and structural symmetry. If microservice deployment cannot respond to such changes in a timely manner, it will result in longer flow-aware routing distances, load imbalance, and longer request response delays due to constrained capacity. As shown in Figure 4g, due to changes in service request nodes, the proposed APC algorithm calculates the shortest flow-aware routing distance as 8605.69 m, edge server s = 57 , which is the minimum value shown in Figure 4a–l. In the scenario shown in Figure 4e, the shortest flow-aware routing distance obtained by the APC algorithm is 8870.70 m, edge server s = 31 , which is the maximum value in Figure 4a–l when the service request node changes. Hence, the subtle changes in service request nodes can easily lead to significant changes in the structural symmetry of microservice deployment and request routing, thereby affecting indicators related to structural symmetry, including the flow-aware routing distance, workload balancing, and request response delay.
Unlike traditional metrics such as network centrality, the proposed definition attempts to measure the structural symmetry of microservice deployment and request routing from both spatial and temporal dimensions. It is worth noting that although shorter flow-aware routing distances can help reduce workload imbalance and request response delay in many cases, they are not entirely consistent because workload imbalance and request response delay are also affected by the local location of the requesting node and the symmetry of the request routing; that is to say, flow-aware routing distance, workload balancing, and request response delay can help us comprehensively examine the structural symmetry of microservice deployment and request routing from a perspective of spatial symmetry and temporal symmetry.
In order to explore the relationship and differences among the three objectives, statistical comparisons of microservice deployment and request routing are summarized in Table 3, where the first line indicates the flow-aware routing distance, workload balancing, and request response delay, and the first column indicates the number of edge servers. After 20 experiments with dynamic microservice requests, the maximum, average, and minimum values of microservice deployment and request routing were calculated.
Table 3 shows the dynamic change process of microservice requests, as well as the proposed APC algorithm responding to microservice requests while maintaining the structural symmetry of microservice deployment and request routing. For the minimum total distance of 8605.69 m ( s = 57 ), there is a 3.079% improvement compared to the maximum distance of 8870.70 m ( s = 31 ); for the minimum workload balancing value of 5.721% ( s = 43 ), there is a 67.686% improvement compared to the maximum value of 9.593% ( s = 31 ); for the minimum request response delay of 1.45 ms ( s = 31 ), there is a 202.718% improvement compared to the maximum value of 4.39 ms ( s = 69 ). Therefore, the proposed APC algorithm can quickly deploy microservices on edge servers, achieving nearby allocation of computing resources, where microservices on edge servers can quickly respond to business requests, reduce end-to-end delay, and help with load balancing.
However, different request nodes have different routing structures and improvements to the three objectives due to their local locations. As indicated in Table 3, when edge server s = 57, the APC algorithm obtains the minimum total distance of 8605.69 m; when edge server s = 43, the APC algorithm obtains the minimum value of average workload balancing of 9.175%; when edge server s = 20, the APC algorithm obtains the minimum value of average request response delay of 3.20 ms. Therefore, placing edge servers at the center of the network often leads to better performance, such as s = 20 , s = 43 , and s = 57 ; conversely, servers placed at the edge of the network tend to achieve worse performance, such as s = 9 , s = 31 , and s = 69 .
To test the convergence performance of the improved APC algorithm, 100 scalability tests were conducted, as shown in Figure 5a,b. The parameters were set as follows: the seeding probability p s e e d = 0.2 , the growing probability p g r o w = 0.4 , the fruiting probability p f r u i t = 0.7 , and the population size of APC P = 200 .
Figure 5a shows the fitness curve as the number of iterations increases from 200 to 2000, where the fitness values were normalized to dimensionless values in the [0, 1] interval for observation. It can be observed that the improved APC algorithm can provide a convergence guarantee or bound on solution quality for the proposed NP-hard multi-objective optimization problem. In Figure 5a, a larger number of iterations may lead to a better solution, but it also requires longer solving time and greater computational overhead. When the number of iterations is 1000, the optimal solution is already very stable, so this value is the trade-off between computational speed and global optimality.
Figure 5b displays the calculation time curve as the number of edge devices increases from 100 to 1000, where the parameters of the APC algorithm remain unchanged. It can be seen that the solving time of the APC algorithm increases linearly with the size of the problem. In Figure 5b, a larger number of edge devices may require longer solving time and greater computational overhead, but the solving performance of the APC algorithm did not show a sharp deterioration. It demonstrates that the proposed APC algorithm has good scalability.

5.3. Comparative Experiments

The comparative experiments selected some baseline algorithms, i.e., GA [4,12], DRL [5,21,22,28], PSO [13,27], ACO [14], and GWO [15]. The algorithm parameters in comparative experiments were set according to Table 4.
Figure 6a–c display a comparison of the flow-aware routing distance, workload balancing, and request response delay under the improved APC approach, GA [4,12], DRL [5,21,22,28], PSO [13,27], ACO [14], and GWO [15].
Firstly, for a comparison of the flow-aware routing distance with 100 edge devices, there is an optimal route that results in the shortest flow-aware routing distance. Shorter flow-aware routing distances can help reduce the deployment cost of microservices and improve structural symmetry, but the results obtained by different algorithms show slight variations. Figure 6a demonstrates that the improved APC approach consistently outperforms the other approaches, with a maximum improvement by up to 3.217%. Although the DRL [5,21,22,28] algorithm is also good, it requires longer solving time.
Secondly, a lower workload balancing rate can measure the structural symmetry and service resilience of microservice deployment from another perspective, although it may not necessarily be consistent with shorter flow-aware routing distances. But it also indicates that multi-objective evaluation of microservice deployment and request routing is complex and necessary. In Figure 6b, the APC approach is superior to other algorithms with a maximum improvement of 15.759% benefiting from the enhanced global and local search abilities.
Thirdly, shorter request response delay means that microservice deployment can respond to user requests faster, which is related to shorter flow-aware routing distances but not entirely consistent. The deployment of microservices located at the edge of the network can easily result in longer response delays, and wireless delay may also affect the optimization results. In Figure 6c, the proposed APC approach can be effectively applied to minimize the request response delay with a maximum improvement of 15.655% over other algorithms because of its better search ability.

5.4. Discussions

This paper deeply explores the joint optimization of microservice deployment and request routing based on an improved APC algorithm.
Firstly, structural symmetry has a significant impact on the efficiency of microservice deployment and request routing, but it cannot be evaluated through a single metric. Our work first develops a multi-objective optimization model to jointly optimize microservice deployment and request routing, and our work systematically considers the spatial symmetry and temporal symmetry, i.e., the flow-aware routing distance, workload balancing, and request response delay. Figure 4a–l and Table 3 analyze the common background of microservice and the key role of edge computing, pointing out the challenges faced by dynamic microservice deployment, request routing, and resource allocation, such as limited resources, unstable environment, and variable demands.
Secondly, in response to these challenges, this paper detailed the APC-based microservice deployment and request routing algorithm, including the improvement of seeding, growing, and fruiting processes. Compared with the classic baseline algorithm, the calculation process of the APC algorithm is greatly simplified, using only three probability parameters to cover global search ability, local optimization ability, and fast convergence ability. It is more suitable for this joint optimization problem, especially under edge resource constraints. The experimental results in Figure 5a,b show that the microservice configuration strategy based on Algorithm 1 and Figure 2 provides an effective optimization method for request routing and resource allocation. Figure 6a–c show that the proposed algorithm has a strong potential and application value in the face of highly dynamic edge computing environments.
Thirdly, the proposed benchmark experiment in Figure 3 provides a good description of the dynamic process and synchronous optimization of microservice deployment. In Figure 4a–l and Figure 5a,b, the performance of the proposed algorithm under different microservice requests, dynamic topologies, and edge server computing capabilities was verified, showing that the APC algorithm can effectively improve microservice deployment and request routing. Our proposal is based on a time-varying network dynamic model, so it can support real-time adaptation, but the optimization calculation requires updating the input.
Lastly, in order to simplify the analysis, this article ignores some factors to provide a comprehensive deployment framework. Due to the limitations of the experimental conditions, our experiments are based on the simulation platform and are not deployed on the real edge computing platform. The convergence and scalability of this algorithm on real MEC platforms with the increasing number of microservices and edge servers, as well as the representativeness and generalizability of the proposed benchmark tests, will be the next step of research. The impact of a real server cluster on joint optimization of microservice deployment and request routing is extremely complex, requiring further research.

6. Conclusions

In large-scale mobile edge computing, microservice deployment and efficient routing are of great significance for improving system performance, optimizing resource allocation, and ensuring real-time requirements. Different from traditional technology, our solution constructed a constrained nonlinear multi-objective optimization model to jointly optimize microservice deployment and request routing, systematically considering the spatial symmetry and temporal symmetry metrics, i.e., the flow-aware routing distance, workload balancing, and request response delay. Then, a lightweight APC algorithm was developed to solve it, and a benchmark experiment was designed to compare with baseline algorithms. The experimental results revealed that the improved APC algorithm is efficient in solving the joint optimization problem of microservice deployment and request routing and is superior to some typical baseline algorithms, with an up to 3.217% improvement in the flow-aware routing distance, an up to 15.759% improvement in the workload balancing, and an up to 15.655% improvement in the request response delay. However, the joint optimization of microservice deployment and request routing is extremely challenging, where the flow-aware routing distance, workload balancing, and request response delay can jointly evaluate the structural symmetry, but they are not completely consistent.
Due to the limitations of the experiment, this work is simulated rather than deployed on a real server cluster. Therefore, the actual running time, memory, wireless delay, communication costs of edge hardware, variance- or entropy-based balancing, Pareto analysis or sensitivity study to tune β, and performance improvement under dynamic workload peaks or server failures may be overlooked. The proposed structural symmetry definition and evaluation metrics for microservice deployment may encounter inconsistencies or conflicts in real-world operations. In the real world, with the increasing number of microservices and edge servers, the scalability and convergence of the proposed algorithm need further testing. In future work, we plan to deploy the proposal on a real server cluster and consider more practical factors to address the aforementioned shortcomings and deficiencies.

Author Contributions

Conceptualization, Z.C.; Methodology, Z.C.; Software, F.Y. and W.L.; Validation, F.Y. and W.L.; Investigation, W.L., J.L. and M.Z.; Data curation, W.L., J.L. and M.Z.; Writing—original draft, F.Y.; Writing—review and editing, Z.C. and F.Y.; Project administration, Z.C.; Funding acquisition, Z.C. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by the National Natural Science Foundation of China (No. 71471102), Major Science and Technology Projects in Hubei Province of China (Grant No. 2020AEA012), and Yichang University Applied Basic Research Project in China (Grant No. A17-302-a13).

Data Availability Statement

The original contributions presented in this study are contained in the article. For further inquiries, please contact the corresponding author.

Acknowledgments

Thank you to the anonymous reviewers for their valuable feedback on this manuscript.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Hu, Y.; Wang, H.; Wang, L.; Hu, M.; Peng, K.; Veeravalli, B. Joint deployment and request routing for microservice call graphs in data centers. IEEE Trans. Parallel Distrib. Syst. 2023, 34, 2994–3011. [Google Scholar] [CrossRef]
  2. Chen, Y.; Wu, C.; Zhang, F.; Lu, C.; Huang, Y.; Lu, H. Topology-aware microservice architecture in edge networks: Deployment optimization and implementation. IEEE Trans. Mob. Comput. 2025, 24, 6090–6105. [Google Scholar] [CrossRef]
  3. Peng, K.; He, J.; Guo, J.; Liu, Y.; He, J.; Liu, W.; Hu, M. Delay-aware optimization of fine-grained microservice deployment and routing in edge via reinforcement learning. IEEE Trans. Netw. Sci. Eng. 2024, 11, 6024–6037. [Google Scholar] [CrossRef]
  4. Xu, B.; Guo, J.; Ma, F.; Hu, M.; Liu, W.; Peng, K. On the joint design of microservice deployment and routing in cloud data centers. J. Grid Comput. 2024, 22, 42. [Google Scholar] [CrossRef]
  5. Hu, M.; Wang, H.; Xu, X.; He, J.; Hu, Y.; Deng, T.; Peng, K. Joint optimization of microservice deployment and routing in edge via multi-objective deep reinforcement learning. IEEE Trans. Netw. Serv. Manag. 2024, 21, 6364–6381. [Google Scholar] [CrossRef]
  6. Cai, Z.; Lei, S.; Li, J.; Yu, C.; Liu, J.; Gong, G. A heuristic optical flow scheduling algorithm for low-delay vehicular visible light communication. Photonics 2025, 12, 693. [Google Scholar] [CrossRef]
  7. Feng, K.; Luo, L.; Xia, Y.; Luo, B.; He, X.; Li, K.; Zha, Z.; Xu, B.; Peng, K. Optimizing microservice deployment in edge computing with large language models: Integrating retrieval augmented generation and chain of thought techniques. Symmetry 2024, 16, 1470. [Google Scholar] [CrossRef]
  8. Hassan, M.U.; Al-Awady, A.A.; Ali, A.; Iqbal, M.M.; Akram, M.; Jamil, H. Smart resource allocation in mobile cloud next-generation network (NGN) orchestration with context-aware data and machine learning for the cost optimization of microservice applications. Sensors 2024, 24, 865. [Google Scholar] [CrossRef]
  9. Aksakalli, I.K.; Çelik, T.; Can, A.B.; TekïnErdoğan, B. Deployment and communication patterns in microservice architectures: A systematic literature review. J. Syst. Softw. 2021, 180, 111014. [Google Scholar] [CrossRef]
  10. Petrakis, E.G.M.; Skevakis, V.; Eliades, P.; Aznavouridis, A.; Tsakos, K. Modsoft-HP: Fuzzy microservices placement in Kubernetes. Electronics 2024, 13, 65. [Google Scholar] [CrossRef]
  11. Li, W.; Li, X.; Chen, L.; Wang, M. Microservice workflow scheduling with a resource configuration model under deadline and reliability constraints. Sensors 2025, 25, 1253. [Google Scholar] [CrossRef] [PubMed]
  12. Ma, W.; Wang, R.; Gu, Y.; Meng, Q.; Huang, H.; Deng, S.; Wu, Y. Multi-objective microservice deployment optimization via a knowledge-driven evolutionary algorithm. Complex Intell. Syst. 2021, 7, 1153–1171. [Google Scholar] [CrossRef]
  13. Chen, X.; Xiao, S. Multi-objective and parallel particle swarm optimization algorithm for container-based microservice scheduling. Sensors 2021, 21, 6212. [Google Scholar] [CrossRef] [PubMed]
  14. Lin, M.; Xi, J.; Bai, W.; Wu, J. Ant colony algorithm for multi-objective optimization of container-based microservice scheduling in cloud. IEEE Access 2019, 7, 83088–83100. [Google Scholar] [CrossRef]
  15. Wang, S.; Zhang, Y.; He, X.; Wang, N.; Lu, Z.; Chen, B.; Pang, S. Microservice deployment in cloud-edge environment using enhanced global search grey wolf optimizer-greedy algorithm. Clust. Comput. J. Netw. Softw. Tools Appl. 2025, 28, 118. [Google Scholar] [CrossRef]
  16. Kumar, M.; Samriya, J.K.; Dubey, K.; Gill, S.S. QoS-aware resource scheduling using whale optimization algorithm for microservice applications. Softw. Pract. Exp. 2024, 54, 546–565. [Google Scholar] [CrossRef]
  17. Cai, Z.Y.; Jiang, S.; Dong, J.H.Z.; Tang, S.J. An artificial plant community algorithm for the accurate range-free positioning of wireless sensor networks. Sensors 2023, 23, 2804. [Google Scholar] [CrossRef]
  18. Wang, Z.; Zhu, J.; Guo, J.; Liu, Y. Microservice deployment based on multiple controllers for user response time reduction in edge-native computing. Sensors 2025, 25, 3248. [Google Scholar] [CrossRef]
  19. Aksakalli, I.K.; Celik, T.; Can, A.B.; Tekinerdogan, B. A model-driven architecture for automated deployment of microservices. Appl. Sci. 2021, 11, 9617. [Google Scholar] [CrossRef]
  20. Zhang, X.; Liang, J.; Lu, Y.X.; Zhang, P.Y.; Bi, Y.X. Differentiated security requirements: An exploration of microservice placement algorithms in internet of vehicles. Electronics 2024, 13, 1597. [Google Scholar] [CrossRef]
  21. Chen, S.; Yuan, Q.; Li, J.; He, H.; Li, S.; Jiang, X.; Yang, J. Graph neural network aided deep reinforcement learning for microservice deployment in cooperative edge computing. IEEE Trans. Serv. Comput. 2024, 17, 3742–3757. [Google Scholar] [CrossRef]
  22. Duan, H.; Ji, Z.; Wu, S.; Chen, Z.; Jiang, C.; Zhang, W. Distributed microservice deployment for satellite edge computing networks: A multi-agent deep reinforcement learning approach. IEEE Trans. Veh. Technol. 2025, 74, 14692–14706. [Google Scholar] [CrossRef]
  23. Shi, Y.; Yang, Y.Y.; Yi, C.Y.; Chen, B.; Cai, J. Toward online reliability-enhanced microservice deployment with layer sharing in edge computing. IEEE Internet Things J. 2024, 11, 23370–23383. [Google Scholar] [CrossRef]
  24. Seo, J.; Jang, S.; Cha, J.; Choi, H.; Kim, D.; Kim, S. MDED-Framework: A distributed microservice deep-learning framework for object detection in edge computing. Sensors 2023, 23, 4712. [Google Scholar] [CrossRef]
  25. Choi, H.J.; Komuro, N.; Kim, W.S. Microservices-based resource provisioning for multi-user cloud VR in edge networks. Electronics 2024, 13, 3077. [Google Scholar] [CrossRef]
  26. He, X.; Tu, Z.Y.; Wagner, M.; Xu, X.F.; Wang, Z.J. Online deployment algorithms for microservice systems with complex dependencies. IEEE Trans. Cloud Comput. 2023, 11, 1746–1763. [Google Scholar] [CrossRef]
  27. Alzahrani, A.; Tang, M. Energy-aware microservice-based saas deployment in a cloud data center using hybrid particle swarm optimization. IEEE Access 2024, 12, 140884–140899. [Google Scholar] [CrossRef]
  28. Jin, Y.; Yao, Z.; Wang, Z.; Ding, G.; He, X.; He, J.; Zhang, C.; Li, J. Dynamic scaling mechanism of IoV microservices based on traffic flow prediction and deep reinforcement learning. Symmetry 2025, 17, 1321. [Google Scholar] [CrossRef]
  29. Zhao, T.Y.; Chen, T.; Sun, Y.D.; Xu, Y. IM-GNN: Microservice orchestration recommendation via interface-matched dependency graphs and graph neural networks. Symmetry 2025, 17, 525. [Google Scholar] [CrossRef]
  30. Lv, W.; Wang, Q.; Yang, P.; Ding, Y.; Yi, B.; Wang, Z.; Lin, C. Microservice deployment in edge computing based on deep Q learning. IEEE Trans. Parallel Distrib. Syst. 2022, 33, 2968–2978. [Google Scholar] [CrossRef]
  31. Cai, Z.; Ma, Z.; Zuo, Z.; Xiang, Y.; Wang, M. An image edge detection algorithm based on an artificial plant community. Appl. Sci. 2023, 13, 4159. [Google Scholar] [CrossRef]
  32. Zhu, J.; Bai, W.; Zhang, H.; Lin, W.; Zhou, T.; Li, K. Adaptive multi-objective swarm intelligence for containerized microservice deployment. Future Gener. Comput. Syst. Int. J. Escience 2026, 174, 108012. [Google Scholar] [CrossRef]
Figure 1. The example for microservice deployment and request routing. These arrows indicate the request routing for microservices.
Figure 1. The example for microservice deployment and request routing. These arrows indicate the request routing for microservices.
Symmetry 18 00195 g001
Figure 2. The flowchart of the APC-based solution mechanism.
Figure 2. The flowchart of the APC-based solution mechanism.
Symmetry 18 00195 g002
Figure 3. The benchmark map with 100 edge devices. Blue circles represent the position of edge devices, and adjacent numbers represent the number of edge devices.
Figure 3. The benchmark map with 100 edge devices. Blue circles represent the position of edge devices, and adjacent numbers represent the number of edge devices.
Symmetry 18 00195 g003
Figure 4. The solutions of the APC-based microservice deployment and request routing algorithm on 100 edge devices. (a) s = 9, (b) s = 18, (c) s = 20, (d) s = 28, (e) s = 31, (f) s = 43, (g) s = 57, (h) s = 59, (i) s = 69, (j) s = 83, (k) s = 91, and (l) s = 95. The blue circle represents the location of the edge device, the adjacent number represents the number of the edge device, the line represents the request routing between edge devices, and the red circle and server represent the deployment location of the edge server.
Figure 4. The solutions of the APC-based microservice deployment and request routing algorithm on 100 edge devices. (a) s = 9, (b) s = 18, (c) s = 20, (d) s = 28, (e) s = 31, (f) s = 43, (g) s = 57, (h) s = 59, (i) s = 69, (j) s = 83, (k) s = 91, and (l) s = 95. The blue circle represents the location of the edge device, the adjacent number represents the number of the edge device, the line represents the request routing between edge devices, and the red circle and server represent the deployment location of the edge server.
Symmetry 18 00195 g004aSymmetry 18 00195 g004bSymmetry 18 00195 g004c
Figure 5. Scalability testing: (a) Fitness curve as the number of iterations increases, (b) Calculation time curve as the number of edge devices increases.
Figure 5. Scalability testing: (a) Fitness curve as the number of iterations increases, (b) Calculation time curve as the number of edge devices increases.
Symmetry 18 00195 g005
Figure 6. Comparison of baseline algorithms: (a) the flow-aware routing distance, (b) the workload balancing, and (c) the request response delay.
Figure 6. Comparison of baseline algorithms: (a) the flow-aware routing distance, (b) the workload balancing, and (c) the request response delay.
Symmetry 18 00195 g006aSymmetry 18 00195 g006b
Table 1. Main symbols.
Table 1. Main symbols.
NotationMeaning
S Set of edge servers
s An edge server
s m a x Number of edge servers
c Core network
C s c o m p The computing capacity of edge server s
C s s t o r The storage capacity of edge server s
M Set of microservices
m m a x The number of microservices
m A microservice
t A time slot
T Set of discrete time slots
t m a x The finite time horizon
R m c o m p Computing resource for processing microservice m
R s , m c o m p ( t ) The overall computation workload required when microservice m is operated on edge server s at time slot t
R m s t o r Storage capacity required to place microservice m
R s , m s t o r ( t ) The overall storage capacity required when microservice m is operated on edge server s at time slot t
γ s , m ( t ) A microservice deployment indicator. We set γ s , m ( t ) = 1 (or 0) if microservice   m is placed on the edge server s (or not) at time slot t .
γ s , m ( t ) The optimal microservice deployment indicator
x M ( t ) All microservice deployment decisions
x M ( t ) The optimal microservice deployment decision at time slot t
γ s , m c o m p ( t ) Fraction of computing capacity for microservice m allocated by edge server s at time slot t , γ s , m c o m p ( t ) [ 0 , 1 ] .
x R ( t ) All resource allocation strategies
m s , m r e q u ( t ) The number of requests for microservice m on edge server s at time slot t
m m r e q u ( t ) Total number of requests for microservice m at time slot t
L ( t ) All request routing strategies
L s , m ( t ) Workload ratio where microservice m is operated on edge server s at time slot t
β The probability that microservice m is outsourced to the remote cloud at time slot t
L s , m ( t ) The minimum processing unit of the request routing scheme
d s , s The flow-aware routing distance between two edge servers s and s
w s s The actual request flows or traffic volumes between two edge servers s and   s
d s , m c o m p ( t ) The computational delay when microservice m is handled on edge server s
r e d g e t r a n ( t ) The transmission rate between edge servers
d s , m t r a n ( t ) The transmission delay when microservice m is handled on edge server s
r c , m t r a n ( t ) The transmission rate of core network when microservice m is transmitted at time slot t
d c , m p r o c ( t ) The processing delay of microservice m outsourced to a remote cloud at time slot t
d m a v g ( t ) The average response delay of microservice m on all edge servers
d s e n s t r a n ( t ) The transmission delay between sensing devices and edge servers
u s ( t ) The state of edge server s at time slot t
v s ( t ) The action space of edge server s at time slot t
F ( t ) The reward function at time slot t
Q ( u , v ) The expected total sum of future rewards for T time steps
α The discount factor to diminish the influence of future rewards on present decision-making
E The expectation with respect to the time-varying system environments
Table 2. Benchmark Dataset and Configuration.
Table 2. Benchmark Dataset and Configuration.
DatasetConfiguration
m m a x 100
s m a x 100
s ( x s , y s ) Rand [1, 100]
w s s 1
C s c o m p Rand [0.0%, 100.0%]
C s s t o r Rand [0.0%, 100.0%]
t m a x 1000 ms
R m c o m p Rand [0.0%, 100.0%]
R m s t o r Rand [0.0%, 100.0%]
F ( t ) Rand [10.0%, 20.0%]
α Rand [5.0%, 10.0%]
β Rand [0.0%, 10.0%]
Table 3. Statistical comparisons of microservice deployment and request routing.
Table 3. Statistical comparisons of microservice deployment and request routing.
Flow-Aware Routing Distance (m)Workload Balancing (%)Request Response Delay (ms)
MaxAvgMinMaxAvgMinMaxAvgMin
s = 9 8964.328718.558631.9235.315%18.583%8.933%21.939.381.71
s = 18 9182.419030.588784.4630.942%17.026%7.848%19.797.792.34
s = 20 9124.538926.388806.3319.213%9.830%5.733%12.453.201.57
s = 28 8900.958729.518653.2821.825%11.477%6.003%16.066.363.77
s = 31 9131.078945.098870.7036.265%19.671%9.593%23.7710.151.45
s = 43 9025.068863.748735.5618.140%9.175%5.721%15.296.114.14
s = 57 8955.878800.288605.6927.964%11.583%6.289%14.464.111.90
s = 59 8985.128876.188624.2234.888%17.407%7.963%20.588.441.55
s = 69 9115.638969.288703.6224.770%10.946%6.808%18.326.754.39
s = 83 9141.808926.608792.3722.588%10.516%6.047%15.124.292.51
s = 91 9165.958939.398751.3630.613%13.871%7.600%17.645.392.11
s = 95 8936.248762.398668.2719.854%10.356%5.945%15.854.843.19
Table 4. Algorithm parameters in comparative experiments.
Table 4. Algorithm parameters in comparative experiments.
AlgorithmPopulation SizeOther Parameters
APC P = 200 of the APC individualsThe seeding probability p s e e d = 0.2 , the growing probability p g r o w = 0.4 , the fruiting probability p f r u i t = 0.7 .
GA [4,12] P = 200 of the chromosomesThe chromosome length Lind = 20, the crossover probability p x = 0.7, and the mutation probability pm = 0.01.
DRL [5,21,22,28] P = 200 of the neurons in each hidden layerA state embedding network comprised a shared stack and multiple heads. This shared stack contained two hidden layers, and each head block contained 100 ReLU units followed by |v| + 1 units with zero-centered tanh activation.
PSO [13,27] P = 200 of the particlesThe location limitation loc = 0.5, the speed limitation sp = [−0.5, 0.5], the self-learning factor c1 = 1.5, and the social learning factor c2 = 1.5.
ACO [14] P   =   200 the of antsThe importance of heuristic factors h = 5.0, the pheromone volatilization factor p = 0.1, and the pheromone importance phi = 1.0.
GWO [15] P = 200 of the gray wolvesProblem dimension dim = 2, and initial positions of the wolf leader (alpha), wolf deputy (beta), and wolf advisor (delta) pos = rand(dim) × 10−5.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Cai, Z.; Yu, F.; Li, W.; Liu, J.; Zhang, M. Multi-Objective Joint Optimization for Microservice Deployment and Request Routing. Symmetry 2026, 18, 195. https://doi.org/10.3390/sym18010195

AMA Style

Cai Z, Yu F, Li W, Liu J, Zhang M. Multi-Objective Joint Optimization for Microservice Deployment and Request Routing. Symmetry. 2026; 18(1):195. https://doi.org/10.3390/sym18010195

Chicago/Turabian Style

Cai, Zhengying, Fang Yu, Wenjuan Li, Junyu Liu, and Mingyue Zhang. 2026. "Multi-Objective Joint Optimization for Microservice Deployment and Request Routing" Symmetry 18, no. 1: 195. https://doi.org/10.3390/sym18010195

APA Style

Cai, Z., Yu, F., Li, W., Liu, J., & Zhang, M. (2026). Multi-Objective Joint Optimization for Microservice Deployment and Request Routing. Symmetry, 18(1), 195. https://doi.org/10.3390/sym18010195

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop