Abstract:
Microservice architecture builds cloud applications as independent components and runs each application process as service. It can improve the flexibility and speed of software update through decoupling. However, microservices still face many challenges, such as, service decomposition, transmission delay, and reliability. This paper uses predicated Petri net (PrT net) to model the event bus-based microservice composition and establish the logical relationship among microservices. The event listening mechanism is a delegated event handling mechanism. When a specified event occurs in the event source, it will notify the specified event listener to perform the corresponding operation. For event-based communication, when an event occurs, the microservice will publish the event. Then, we propose a PB (primary-backup) replication allocation strategy that meets the sub-deadline through microservice instances of the primary and backup replica for improving the overall reliability of microservice composition. Besides, the PB replica deployment strategy is analyzed via two cases: single task and multi task PB replica. By deploying the primary and backup replica of the task in different containers or host resources, the goal of improving the reliability of cloud applications is the correctness of microservice reliability model and PB replica deployment strategy is verified achieved. The properties of constructed models are established and the correctness of both the microservice reliability model and PB replica deployment strategy is verified by using the relevant theories of PrT net. Finally, several experiments are carried out to verify the effectiveness of the modeling and analysis method. It is shown from experimental results that the proposed microservice reliability strategy is effective by taking guarantee ratio as reliability parameter.