L2 - Architectural Styles
L2 - Architectural Styles
Styles
SE205.3
Level 2
1 Publish 2 Layered
Subscribe
3 Shared data 4 Client Server
4. Database Layer:
• Responsibilities: Manages the actual storage of data.
• Examples: Relational databases (MySQL, PostgreSQL),
NoSQL databases (MongoDB, Cassandra).
• Technologies: Database management systems (DBMS).
Example of Layered Architecture
Consider an e-commerce application:
Presentation Layer:
• Displays product listings, shopping carts, and checkout forms.
• Handles user input and sends requests to the business logic
layer.
Business Logic Layer:
• Processes user actions like adding items to the cart, applying
discounts, and calculating totals.
• Validates user input and applies business rules.
Data Access Layer:
• Interacts with the database to fetch product details, store user
information, and manage orders.
• Uses SQL queries or an ORM (Object-Relational Mapping) tool to
manage data.
Benefits of Layered Architecture
Key Concepts
1. Client: A component that initiates requests to a server. Clients
are typically user-facing applications, such as web browsers,
mobile apps, or desktop applications.
2. Server: A component that receives and processes requests from
clients. Servers provide services, such as hosting web pages,
running applications, or storing data.
3. Network: The communication medium that connects clients and
servers. This can be a local network (LAN) or the internet.
Client Server Architecture
Client Server Architecture
Structure
Key Concepts
1. Filter: A processing component that transforms input
data into output data. Filters are designed to be
independent and reusable.
2. Pipe: A conduit that transports data from one filter to the
next. Pipes are responsible for data transfer but do not
process data themselves.
3. Pipeline: The overall sequence of connected filters and
Pipe-and-Filter Architecture
Structure
1. Filters: Perform specific processing tasks, such as data
transformation, aggregation, or validation.
2. Pipes: Transfer data between filters, ensuring a
unidirectional flow.
3. Pipeline: The entire sequence of filters and pipes,
representing the complete processing workflow
Characteristics of Pipe-and-Filter
Architecture
1. Modularity: Filters are self-contained and can be developed,
tested, and maintained independently.
2. Reusability: Filters can be reused across different pipelines
or applications.
3. Flexibility: Pipelines can be easily reconfigured by adding,
removing, or rearranging filters.
4. Scalability: Pipelines can be scaled by parallelizing filters or
distributing them across multiple nodes.
Use Cases of Pipe-and-Filter
Architecture
1. Data Processing: ETL (Extract, Transform, Load) processes
in data warehousing.
2. Compiler Design: Lexical analysis, syntax analysis, and
code generation stages in compilers.
3. Multimedia Processing: Audio and video processing
pipelines.
4. Network Protocol Stacks: Processing network packets
through various protocol layers.
Example of Pipe-and-Filter Architecture
Consider a data processing application that reads data from a
file, processes it, and writes the output to another file:
1. Filters:
• ReadFilter: Reads data from the input file.
• ProcessFilter: Processes the data (e.g., data
transformation).
• WriteFilter: Writes the processed data to the output file.
2. Pipes:
• Pipe1: Connects ReadFilter to ProcessFilter.