官术网_书友最值得收藏!

Behavioral Patterns

In software development, behavioral design patterns focus on the communication and interaction between objects. Interaction and communication includes responsibility assignment, the encapsulation of behaviors, and the delegation of requests. With the microservice architecture, behavioral patterns focus on the communication between microservices and the interaction of services with orchestration tools.

For instance, let's consider the execution of a microservice that checks a user's quota daily. It can be implemented by an infinite loop that includes 24 hours of sleep and the execution of the quota check. Although it works, it consumes additional resources during sleep and creates an inefficient architecture. With the behavioral pattern of the "scheduled job pattern," orchestration tools could handle the scheduling of the microservice and ensure that it runs every 24 hours.

In Kubernetes, containers are encapsulated inside pods, which are the primary interest of behavioral patterns. Behavioral patterns are focused on the interaction and communication of the Kubernetes resources, namely pods, with the Kubernetes services. Communication and interaction within the controller system could include the distribution of pods to nodes, the scheduling of pods, or metadata distribution by the Kubernetes master and node components.
The following behavioral patterns are covered in the following sections:

  • The job pattern
  • The scheduled job pattern
  • The daemon service pattern
  • The singleton service pattern
  • The introspective pattern
主站蜘蛛池模板: 昭觉县| 宁南县| 宜川县| 炎陵县| 乐山市| 河池市| 翁源县| 缙云县| 托克托县| 台安县| 科尔| 南木林县| 柳江县| 忻州市| 乐清市| 波密县| 岢岚县| 沂水县| 茶陵县| 隆回县| 大埔县| 五峰| 吉安县| 北流市| 佳木斯市| 封丘县| 宜宾市| 弥勒县| 湘潭县| 新建县| 明光市| 饶河县| 临安市| 肇东市| 浑源县| 丰镇市| 武强县| 日土县| 东兴市| 漯河市| 新和县|