s6 Flashcards

(31 cards)

1
Q

What is a key consideration when observing architectural styles in real systems?

A

Real systems, especially large ones, rarely use a single architectural style; they often employ a hybrid approach, mixing several styles. For example, Skype combines Client-Server with Peer-to-Peer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define Monolithic Architecture.

A

A single-tiered software system where all requirements (user interface, business rules, data access) are combined into a single platform or application. It is self-contained, with one application overseeing all functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Provide an example of Monolithic Architecture

A

Microsoft Word

where user interface, business rules (like line breaks and text wrapping), and data access are all in one application, deployed on a single device.

Other examples include old financial systems and many simple video games.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

List pros of Monolithic Architecture.

A

Easy to develop.
Easy to deploy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

List cons of Monolithic Architecture.

A

Codebase becomes harder to understand over time.

Large size can decrease performance.

Difficult to maintain and change.

Difficult to scale (can only scale by running multiple copies).

Forces commitment to specific technologies.

Hard to swap out components later.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define Client-Server Architecture.

A

An architecture that divides software system functionality into two conceptual parts: a server that provides resources/services and listens for requests, and a client that requests these resources/services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a key benefit of separating the client and server?

A

It introduces a layer of abstraction; the client does not need to know how the server performs its tasks, viewing the server as a black box. Servers may use an API to format messages between client and server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does a server typically handle multiple clients?

A

One server can accommodate multiple clients, usually requiring some form of scheduling system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give an example of Client-Server Architecture.

A

A simple website where the user’s web browser is the client, and the web server hosting the site is the server. Requests and responses occur via HTTP/HTTPS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

List pros of Client-Server Architecture.

A

Separation of concerns.

Scalability (new clients/servers can be added, servers can be upgraded).

Centralized control allows for tighter security and easier development.

Clients and servers can be deployed anywhere.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

List cons of Client-Server Architecture.

A

Can be difficult to manage traffic.
Server failure can cause the entire system to fail.
Maintaining servers can be costly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Multi-Tier Architecture?

A

A family of architectural styles based on the Client-Server model, focused on dividing a software system into multiple layers or tiers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe the 2-Tier Model.

A

The prototypical client-server model where the client handles presentation, and the server handles logic and data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe the 3-Tier Model and give an example.

A

Presentation tier: Handles user interface.

Application tier: Handles system logic.

Data tier: Handles data storage and retrieval.

Example: Web applications, where the presentation tier is rendered by the client’s browser, the application tier is middle-layer software processing content and requests, and the data tier is the back-end database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an N-Tier Model?

A

A generalization of the 3-tier model with ‘n’ distinct layers. Common layers include: Presentation, Business (sometimes split into Business and Application/Services), Persistence, and Database. Layers are isolated, meaning changes in one layer generally don’t affect others.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the core principles of Multi-Tier Architecture?

A

Layers are isolated: Changes in one layer generally don’t impact other layers.

Separation of concerns: Components in a layer deal only with logic pertaining to that layer.

Layers are closed: Layers typically only interact with the layer directly above or below them (requests move layer by layer).

17
Q

What are variants to the “closed layers” principle in Multi-Tier Architecture?

A

Open layers: Allow communications to skip the layer immediately adjacent.

Specific components: Some components can interact with components in multiple layers, effectively forming their own layer.

18
Q

List pros of Multi-Tier Architecture.

A

Allows for greater scalability.

Separation of the data tier/layer improves security and data integrity.
Easier to maintain and upgrade due to isolation and separation of concerns.

Easy to test due to isolation (dummy layers can be used).

19
Q

List cons of Multi-Tier Architecture.

A

Dividing the system into layers can be difficult to design and implement.
Adding too many layers can increase complexity.
Architecture sinkhole: Requests flow through multiple layers with little or no processing.
Without careful management, layered systems can drift into monolithic architectures.

20
Q

What is Representational State Transfer (REST)?

A

An architectural style that standardizes web systems. Web services conforming to REST are called RESTful. It builds on the Client-Server architecture.

21
Q

List the six constraints of REST.

A

Client-Server architecture: Enforces separation of concerns.

Statelessness: The server does not retain session information; each request is understood in isolation.

Cacheability: Clients and intermediaries can cache responses; servers define if responses are cacheable.

Layered system: Clients cannot tell if they are connected to the end server or an intermediary.

Code on demand (optional): Servers can extend client functionality by transferring executable code (e.g., JavaScript).

Uniform interface: Standardized interface for requests and responses.

22
Q

What are the four key requirements of the Uniform Interface constraint in REST?

A

Resource identification in requests: Individual resources are identified (e.g., using URIs); a representation (e.g., JSON, HTML) may be returned.

Resource manipulation through representations: The returned representation has enough info for the client to manipulate the resource.

Self-descriptive messages: Messages contain the information needed to process them (e.g., file type).

(The fourth requirement is Hypermedia as the Engine of Application State - HATEOAS, though not explicitly detailed in this section of the presentation, it’s a fundamental part of a uniform interface).

23
Q

Describe an example of an HTTP-based RESTful web application.

A

Resources identified using URIs (e.g.,http://example.webapplication.com).

Responses defined by media types (e.g., application/json, image/png).
Requests use HTTP protocol (GET, POST, PUT, DELETE).

24
Q

Define Safe, Idempotent, and Cacheable in the context of HTTP methods.

A

Safe: Method does not change the server’s state.

Idempotent: Using the method multiple times on a resource is equivalent to using it once.

Cacheable: Responses can be cached for future reuse.

25
What are the properties (Safe, Idempotent, Cacheable) of GET, POST, PUT, and DELETE HTTP methods?
GET: Safe, Idempotent, Cacheable POST: Not Safe, Not Idempotent, Cacheable PUT: Not Safe, Idempotent, Not Cacheable DELETE: Not Safe, Idempotent, Not Cacheable
26
Define Peer-to-Peer (P2P) Architecture.
An architecture that distributes tasks between equal participants, known as peers. Peers make their resources available to other peers without central coordination and are both suppliers and consumers.  
27
What is Pure P2P (Unstructured P2P) Architecture? Give an example.
No structure is imposed on the network; peers randomly form connections. A peer contacts all available peers to find a resource, and those peers pass on the request if they can't fulfill it (flooding). Example: Gnutella.  
28
List pros of Pure P2P Architecture.
Easy and cheap to set up and maintain.   No central point of failure.   System performance scales with users.  
29
List cons of Pure P2P Architecture.
Flooding increases network traffic and load on peers.   Security is much harder to manage.   Lack of centralization makes content availability and backups harder. Harder to control (e.g., illegal content).  
30
What is Hybrid P2P Architecture? Give examples.
Combines P2P and Client-Server architectures. Examples include using a central server to help peers find each other (like BitTorrent trackers) or using P2P for some functionalities and Client-Server for others (like Skype or some multiplayer games). It helps reduce the impact of flooding.  
31
Briefly describe how BitTorrent works as a case study.
A peer contacts a tracker for a resource. The tracker helps find other peers with the resource. The peer then requests small pieces of the resource from multiple available peers using a piece selection algorithm, maximizing typically low upload speeds. The peer can also share downloaded pieces with others.