An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture, similar to software design pattern but have a broader scope.
Application is splittered horizontally into layers so that a request from request to database will go through all the layers.
- Presentation layer (also known as UI layer)
- Application layer (also known as service layer)
- Business logic layer (also known as domain layer)
- Data access layer (also known as persistence layer)
This pattern consists of two parties; a server and multiple clients. The server component will provide services to multiple client components.
This pattern consists of master and slaves. The master component distributes the work among identical slave components, and computes a final result from the results which the slaves return. Ex: DB replication.
This pattern can be used to process a stream of data. processing is enclosed within a filter component. Data is passed through pipes for buffering or for synchronization purposes.
A broker component is responsible for the coordination of communication among components in distributed systems with decoupled components. Ex: Kafka
In this pattern, individual components are known as peers. Peers may function both as a client, requesting services from other peers, and as a server, providing services to other peers. Ex: Torrent, blockchain
This pattern primarily deals with events and has 4 major components; event source, event listener, channel and event bus. Sources publish messages to particular channels on an event bus. Listeners subscribe to particular channels. Listeners are notified of messages that are published to a channel to which they have subscribed before.
Model-view-controller pattern (MVC)
Divides an interactive application in to 3 parts as,
- model — contains the core functionality and data
- view — displays the information to the user
- controller — handles the input from the user
This separates internal representations of information from the presentation. It decouples components and allows efficient code reuse.
This pattern is useful for problems which has no deterministic solution strategies. It has 3 main components.
- blackboard — a structured global memory containing objects from the solution space
- knowledge source — specialized modules with their own representation
- control component — selects, configures and executes modules.
Components may produce new data objects that are added to the blackboard. Components look for particular kinds of data on the blackboard, and may find these by pattern matching with the existing knowledge source. Ex: Speech recognition.
This pattern is used for designing a component that interprets programs written in a dedicated language. It mainly specifies how to evaluate lines of programs, known as sentences or expressions written in a particular language. Ex: SQL