Ruan Yifeng’s study note “Introduction to Software Architecture” records the 5 most commonly used software architectures: 1. Layered architecture is well known
Event-driven architecture
A software architecture that communicates through events
Event Mediator: Dispatches different events to different BUSINESS logic unit event channels: Event Processor: Implements the business logic. After processing, an event is emitted to trigger the next operation
Advantages of distributed asynchronous architecture, high decoupling between event processors, good scalability and wide applicability of the software, all kinds of projects can be used for good performance, because of the asynchronous nature of the event, the software is not easy to block the event processor can be independently loaded and unloaded, easy to deploy
The disadvantages involve asynchronous programming (consider remote communication, loss of response, etc.), relatively complex development to support atomic operations, and the difficulty of rolling back the distributed and asynchronous nature of the architecture makes it difficult to test because events pass through multiple processors
3. Microcore architecture is also known as plug-in architecture. It refers to the fact that the kernel of the software is relatively small and the main functions and business logic are implemented through plug-ins.
The core usually contains only minimal functionality for the system to run. Plug-ins are independent of each other, and communication between plug-ins should be kept to a minimum to avoid interdependence problems.
Advantages of good function extensibility (extensibility), what function is needed, the development of a plug-in can be isolated between functions, plug-ins can be independently loaded and unloaded, making it easier to deploy, high customizability, adapt to different development needs can be gradually developed, gradually increase the function
Weaknesses: The scalability of the kernel is poor, and the kernel is usually an independent unit, which makes it difficult to implement distributed development because it involves the communication between plug-ins and the kernel and the internal plug-in registration mechanism
4. Microservices architecture
5. Cloud architecture is not well understood
The mode is divided into two parts: Processing Unit and Virtualized Middleware.
Processing unit: Implements the business logic
Virtual middleware:
Responsible for communication, holding sessions, data replication, distributed processing, processing unit deployment.
Virtual middleware consists of four components:
Messaging Grid: Manages user requests and sessions, and decides which processing unit to assign to when a request comes in.
Data Grid: Replication of Data to each processing unit, i.e. Data synchronization. Ensure that all processing units get the same data.
Processing Grid: Optional. If a request involves different types of Processing units, this middleware coordinates the Processing units
Deployment Manager: Responsible for starting and shutting down processing units, monitoring load and response time, starting new processing units when load increases, closing processing units when load decreases.
But not long ago, I read the textbook for the Architect exam, which talks about the architectural styles of software, divided into five categories:
1. Sequential execution of data flow style. Includes batch sequences and pipes/filters.
2. The call/return style system adopts the call and return mechanism, which is a diet-and-conquer strategy in essence. The main idea is to decompose the complex large system into several subsystems to reduce the complexity and increase the modifiability. Including 1) main program/subroutine 2) Object-oriented style Objects interact through functions and methods. 3) Hierarchy style the upper layer calls the lower layer. CS, BS, MVC, MVP are all hierarchies.
3. Independent component style emphasizes that each component in the system is a relatively independent individual, and they do not communicate directly with each other, so as to reduce coupling degree and improve flexibility. Including: 1) process communication via messaging to connect components and 2) event subsystem based implicit invocation style. The system does not invoke the component directly; the component’s procedure registers with the event, and when the event is triggered, all the components registered in it are executed. Observer mode.
I think the advantage of the primary event system is that the call and the called are not directly related, decoupled.
4, virtual machine style artificial construction of an operating environment, the system runs in it, can parse and run custom language, increase the flexibility of the architecture. Including 1) interpreter and 2) rule-centric
Warehouse style Data-centric architecture. A data store resides at the center of the architecture and is frequently accessed and updated by other artifacts. A central database around which independent artifacts are executed. 1) database 2) hypertext system 3) blackboard. The blackboard is the equivalent of sharing data. Knowledge sources interact through the blackboard.
So what is the relationship between the software architecture style mentioned in the textbook and the 5 commonly used architectures mentioned by Ruan Yifeng?
As I understand it, software architectural style is the type of software; Architecture is the structural type of software. Here are five common architectures that you can try to group into a style:
1. Hierarchical structure — Call/return style
Event-driven architecture — component independent style
3. Microcore architecture — standalone component style
4. Microservices Architecture — standalone component style
5. Cloud Architecture — Standalone component style
I think there’s something wrong with that, so let me write that down.