week 7 Flashcards
(22 cards)
What are architectural styles
It is a general, reusable solution to a commonly occurring problem in software architecture within a given context
What is monolithic architecture
Single tiered software system where all the apps requirements and functionalities are combined into a single platform
it is self contained, one app handles everything UI, business logic and data access.
it can be decomposed into smaller parts, like modules in the code but its a single app for deployment.
pros of monolithic
They easy to develop initially
they easy to deploy
cons of monolithic
- hard to understand overtime as codebase can become complexed and tangled
- performance issues with size
- difficult to scale
- changing technologies can be hard
- replacing single components ( oven in kitchen)
What is client server architecture
system is divided into 2 key parts,
server - provides resources and services to clients
client - request those resources
layer of abstraction because server is black box for client.
pros of client server
- separation of concerns
- scalability -> adding client or upgrading servers
- centralized control on the server ( security)
-flexible deployment -> can be located anywhere as long as they can communicate
cons of client server
- traffic management - bottleneck
- server failure - trap thick
- server maintenance - expensive
Multi tier models ?
dividing basic client server into further layers
common 3 tier:
- Presentation tier - UI, html, css and JS
- Application tier - business logic and client requests
- Data storage - DBMS
N tier model
- Presentation Layer: UI.
- Business Layer: Handles business rules and logic. (Sometimes split further into a separate Application/Services layer).
- Persistence Layer: Handles data access operations (saving/retrieving data), logging.
- Database Layer: The actual database.
Key idea:
- Layers are isolated;
- changes in one layer ideally don’t ripple through others.
- layers typically closed, talk to neighbours
Multi tier pros
greater scalability
improved security and data integrity
easier to maintain, upgrade and test
Multi tier cons
can be difficult to design and implement
increased complexity
architectural sinkhole - requests passing through many layers for no reason
REST as part of client server ?
architectural style specifically designed for standardizing web systems and web services
what makes system RESTful
- client server architecture
- statelessness - doesnt remember, every request must have all info
- cache ability - clients can cache respsonses that servers explicitly define are cacheable
- layered system
- code on demand - servers can extend client functionality by transferring executable code
- Uniform interface - standardsizes how clients and serviers interact ( 3 key requirements)
Uniform Interface - 3 Key Requirements
- Resource identification in requests - using URIs ( uniform resource identifiers) so like https://asdf/users/12. Returns liek json format not raw data
- resource manipulation through representations -representation returned to client should contain enough info for client to modify or delete that resource on the server
- Self-descriptive mssgs - each mssg must include enough info for the receiver to process it ( using the http headers to specify the format)
Properties of HTTP Methods
Safe: The method does not change the server’s state (e.g., GET).
Idempotent: Using the method multiple times on the same resource has the same effect as using it once (e.g., multiple identical PUT or DELETE requests).
Cacheable: Responses can be stored for future reuse.
http and their properties
GET: Fetches a representation of a resource (e.g., get product details).
Safe, Idempotent, Cacheable.
POST: Submits data to a resource for processing, often to create a new resource (e.g., create a new order).
Not Safe, Not Idempotent, Cacheable (only if the response indicates it).
PUT: Replaces the target resource with the attached representation (or creates it if it doesn’t exist at that URI) (e.g., update a user’s entire profile).
Not Safe, Idempotent, Not Cacheable.
DELETE: Deletes the target resource (e.g., delete a product).
Not Safe, Idempotent, Not Cacheable.
What is peer to peer architecture
distributes tasks and resources between equal participants.
peers make their resources available to other peers without any central coordination
pure P2P / unstructured P2P
No predefined structure is imposed on the network of peers.
Peers randomly form connections with each other.
To find a resource, a peer might contact all available peers it knows, and those peers, in turn, might pass the request on if they can’t fulfil it (this is known as “flooding”).
pure P2P pros
Easy and cheap to set up and maintain
no central point of failure
system performance scales with peers
pure P2P cons
Flooding- network traffic and heavy load on each peer
Security - harder to manage no central authority
content availability - peers holding specific content go offline
what is Hybrid P2P
Combines P2P and Client-Server architectures to get benefits from both.
Examples:
Using a central server to help peers find each other (e.g., a “tracker” in BitTorrent helps a downloader find other peers who have parts of the desired file).
e.g. Skype for login [client-server] and calls [P2P];
some multiplayer games for matchmaking [client-server] and gameplay [P2P]).
Hybrid P2P can reduce the impact of flooding found in pure P2P systems.