Podcast
Questions and Answers
Which statement accurately reflects the role of nodes in a distributed system?
Which statement accurately reflects the role of nodes in a distributed system?
- Nodes operate independently without any need for coordination.
- Each node contributes to a single point of failure to ensure system integrity.
- Nodes serve only to provide redundancy and do not actively participate in processing or storage.
- Nodes work together, communicate over a network, and coordinate their activities to achieve a common goal. (correct)
What is the most critical consideration when designing distributed systems regarding the handling of increased demand?
What is the most critical consideration when designing distributed systems regarding the handling of increased demand?
- Centralized control to manage the demand from a single point
- Ignoring the need for scalability and focusing on optimizing existing resources
- Horizontal scalability, distributing duties and adding nodes as needed (correct)
- Vertical scalability by adding more processing power to existing nodes
In the context of distributed systems, what is the primary aim of transparency?
In the context of distributed systems, what is the primary aim of transparency?
- To provide detailed logs of all communications between nodes for auditing purposes
- To expose the underlying complexities of the distributed architecture to users
- To hide the complexities of the distributed architecture, presenting the system as a unified whole (correct)
- To ensure all nodes are visible and accessible for direct maintenance
Which design principle is most crucial for maintaining continuous operation in a distributed system despite individual node failures?
Which design principle is most crucial for maintaining continuous operation in a distributed system despite individual node failures?
Why is decentralization a key principle in distributed systems design?
Why is decentralization a key principle in distributed systems design?
How does the flexibility principle influence the architecture of distributed systems?
How does the flexibility principle influence the architecture of distributed systems?
What is the defining characteristic of client-server architecture in distributed computing?
What is the defining characteristic of client-server architecture in distributed computing?
In a client-server architecture, which component is responsible for processing requests and responding accordingly?
In a client-server architecture, which component is responsible for processing requests and responding accordingly?
Within the context of client-server architecture, what role does the network play?
Within the context of client-server architecture, what role does the network play?
In a three-tier architecture, what distinguishes the application server from the database server?
In a three-tier architecture, what distinguishes the application server from the database server?
What is a significant limitation of client-server architecture concerning data availability?
What is a significant limitation of client-server architecture concerning data availability?
Which of the following scenarios accurately describes a real-life application of client-server architecture?
Which of the following scenarios accurately describes a real-life application of client-server architecture?
Within a peer-to-peer (P2P) architecture, what is the most distinguishing characteristic of the nodes?
Within a peer-to-peer (P2P) architecture, what is the most distinguishing characteristic of the nodes?
What is a key property of P2P architecture regarding authority and control?
What is a key property of P2P architecture regarding authority and control?
How does the self-organization characteristic manifest in P2P networks?
How does the self-organization characteristic manifest in P2P networks?
What is the primary advantage of P2P systems in terms of scalability compared to client-server systems?
What is the primary advantage of P2P systems in terms of scalability compared to client-server systems?
How does P2P architecture enhance fault tolerance compared to traditional client-server models?
How does P2P architecture enhance fault tolerance compared to traditional client-server models?
What is a significant security risk inherent in P2P architectures?
What is a significant security risk inherent in P2P architectures?
In the context of P2P architecture, what distinguishes unstructured P2P networks?
In the context of P2P architecture, what distinguishes unstructured P2P networks?
How do structured P2P networks, such as Chord, index resources?
How do structured P2P networks, such as Chord, index resources?
Which P2P model combines elements of both unstructured and structured P2P networks?
Which P2P model combines elements of both unstructured and structured P2P networks?
What is the role of middleware in distributed systems?
What is the role of middleware in distributed systems?
How does middleware simplify the development of distributed applications?
How does middleware simplify the development of distributed applications?
Within the functions of middleware, what is the purpose of message queuing?
Within the functions of middleware, what is the purpose of message queuing?
Which type of middleware is specifically designed to enable distributed objects to communicate with each other?
Which type of middleware is specifically designed to enable distributed objects to communicate with each other?
Which of the following exemplifies database middleware?
Which of the following exemplifies database middleware?
In the context of distributed systems, what do communication protocols primarily define?
In the context of distributed systems, what do communication protocols primarily define?
What is the role of the Domain Name System (DNS) in distributed systems?
What is the role of the Domain Name System (DNS) in distributed systems?
What mechanisms ensure that multiple nodes can access shared resources safely and efficiently?
What mechanisms ensure that multiple nodes can access shared resources safely and efficiently?
What is the purpose of concurrency control in distributed systems?
What is the purpose of concurrency control in distributed systems?
What is a key characteristic of exclusive locks (X-locks) in concurrency control?
What is a key characteristic of exclusive locks (X-locks) in concurrency control?
What potential issue can deadlocks cause?
What potential issue can deadlocks cause?
What describes the state of semaphore where the shared resource is available and can be accessed?
What describes the state of semaphore where the shared resource is available and can be accessed?
Flashcards
Distributed System
Distributed System
A collection of independent computers appearing as a single, cohesive system, working through a network to achieve a common goal.
Scalability
Scalability
The ability of a system to handle increased demand by adding more nodes horizontally.
Fault Tolerance
Fault Tolerance
The system's ability to continue functioning, even if nodes fail.
Decentralization
Decentralization
Signup and view all the flashcards
Transparency
Transparency
Signup and view all the flashcards
Flexibility
Flexibility
Signup and view all the flashcards
Client-Server Architecture
Client-Server Architecture
Signup and view all the flashcards
Client
Client
Signup and view all the flashcards
Server
Server
Signup and view all the flashcards
Network
Network
Signup and view all the flashcards
Two-Tier Architecture
Two-Tier Architecture
Signup and view all the flashcards
Multi-Tier Architecture
Multi-Tier Architecture
Signup and view all the flashcards
Peer-to-Peer Architecture
Peer-to-Peer Architecture
Signup and view all the flashcards
All peers are equal
All peers are equal
Signup and view all the flashcards
Decentralized
Decentralized
Signup and view all the flashcards
Autonomous
Autonomous
Signup and view all the flashcards
Middleware
Middleware
Signup and view all the flashcards
Inter-process communication
Inter-process communication
Signup and view all the flashcards
Remote procedure calls
Remote procedure calls
Signup and view all the flashcards
Message queuing
Message queuing
Signup and view all the flashcards
Security and authentication
Security and authentication
Signup and view all the flashcards
Load balancing
Load balancing
Signup and view all the flashcards
Message-oriented middleware
Message-oriented middleware
Signup and view all the flashcards
Object-oriented middleware
Object-oriented middleware
Signup and view all the flashcards
Communication Protocols
Communication Protocols
Signup and view all the flashcards
TCP
TCP
Signup and view all the flashcards
UDP
UDP
Signup and view all the flashcards
HTTP/HTTPS
HTTP/HTTPS
Signup and view all the flashcards
MQTT
MQTT
Signup and view all the flashcards
RPC
RPC
Signup and view all the flashcards
Websocket
Websocket
Signup and view all the flashcards
Naming
Naming
Signup and view all the flashcards
Addressing
Addressing
Signup and view all the flashcards
Synchronization in Distributed Systems
Synchronization in Distributed Systems
Signup and view all the flashcards
Synchronization
Synchronization
Signup and view all the flashcards
Study Notes
- A distributed system is a collection of systems that appear to the end user as one cohesive system.
- In a distributed system, nodes work together over a network to contribute processing power, storage, or memory to create a powerful, scalable, fault-tolerant system.
Design Principles of Distributed Systems
- Scalability involves designing systems to scale horizontally by adding more nodes to handle increased demand.
- Fault Tolerance means systems continue to function even if one or more nodes fail.
- Decentralization requires systems to to avoid single points of failure and bottlenecks
- Transparency requires systems to provide seamless user experiences by hiding complexities of the distributed architecture, so the system appears as a single, unified whole.
- Flexibility requires systems to accommodate different hardware, software, and network configurations.
Client-Server Architecture
- Client-server architecture is a computing concept where multiple client nodes request service from a central server system.
- The server processes requests and responds.
Client
- A client is the requesting entity, such as a device or application requesting services or data from a server, and initiates communication.
- Web browsers and mobile apps are examples of clients.
Server
- A server is the providing entity, such as a device or software application that provides services, resources, or data upon a client's request.
- Web servers, database servers, and file serversare examples of servers
Network
- The network is the communication medium connecting clients and servers which can be a LAN (Local Area Network) or WAN (Internet).
Two-Tier Architecture
- In two-tier architecture the client communicates directly with the server.
- Example: a desktop app accessing a database
Three-Tier Architecture
- Three Tier Architecture = Client + Application Server + Database Server
- The application server processes business logic before accessing the database using the server.
- Example: a web app where the browser communicates with an API (server) that fetches data from a database.
Multi-Tier Architecture (N-Tier)
- More than three layers, adding load balancing, caching, and security layers.
- This architecture is used in large scale cloud applications.
Advantages of Client-Server Architecture
- Data is stored and managed centrally.
- Servers enforce access control and authentication.
- Servers can handle multiple clients efficiently.
- Clients access data from one source, ensuring updated data.
Disadvantages of Client-Server Architecture
- The server may slow down if too many clients request data at once.
- Clients lose access to data if the server crashes.
- This setup can be costly
Examples of Client-Server Architecture
- Web browsing: browsers requesting a webpage from a server.
- Email services: email apps connecting to an email server (e.g., Outlook, Gmail).
- Cloud storage: Google Drive and Dropbox uses this model for file storage.
- Online banking: apps communicate with central servers for transaction processing.
Peer-to-Peer Architecture (P2P)
- P2P is a distributed system architecture where all nodes, or peers, are equal and act as both clients and servers.
- Peers share resources like files or computing power.
Key Characteristics of P2P Architecture
- All peers are equal
- There is no central authority so it is decentralized
- Each peer operates autonomously
Advantages of P2P Architecture
- Improved scalability because each peer can contribute to the network.
- Increased fault tolerance because other peers can take over responsibilities of failed peers
- Better resource allocation as the system efficiently utilizes resources.
Disadvantages of P2P Architecture
- This can be more complex to design and implement as compared to client-server.
- This has increased security risks
- Network congestion can occur
P2P Architecture Models
- Unstructured P2P does not have a centralized index.
- Gnutella an example of unstructured P2P architecture
- Structured P2P uses a distributed hash table (DHT) to index resources.
- Chord is an example of Structured P2P architecture
- Hybrid P2P combines elements of unstructured and structured P2P networks.
- BitTorrent is an example of Hybrid P2P architecture
Examples of P2P Architecture
- BitTorrent is a file sharing network
- Bitcoin allows users to share and verify transactions.
Middleware
- Middleware is software that acts as an intermediary between distributed applications to enable communication, data exchange, and coordination.
- Middleware provides a layer of abstraction to allow developers to focus on application logic.
Functions of Middleware
- Inter-process communication(IPC) facilitates communication between different processes across networks.
- Remote procedure calls(RPCs) and Remote Method Invocation(RMI) enables function/method execution across different machines.
- Message queuing ensures asynchronous communication between components.
- Security and authentication manages access control and encryption.
- Load balancing distributes workload across multiple servers.
Middleware Technologies
- Message-oriented middleware uses message queues or asynchronous communication.
- Apache Kafka, and RabbitMQ are examples of Message-oriented middleware
- Object-oriented middleware enables distributed objects to communicate.
- CORBA is an example of Object-oriented middleware
- Database middleware provides a bridge between databases and applications.
- ODBC and JDBC are examples of Database middleware
- Cloud middleware connects cloud applications and services.
- AWS Lambda is an example of Cloud middleware
Communication Protocols
- Communication protocols define the rules and formats for data exchange between nodes.
Key Communication Protocols:
- Transmission Control Protocol (TCP) is a Transport Layer Protocol
- User Datagram Protocol (UDP) is a Transport Layer Protocol
- HTTP/HTTPS: used in web-based distributed systems, is an Application Layer Protocols
- Message Queuing Telemetry Transport (MQTT) for IoT applicationsis an Application Layer Protocols
- RPC allows calling procedures on remote systems and is an Remote Communication Protocol
- RMI is an Remote Communication Protocol
- Websocket enables real-time bidirectional communication in web applications as an Event-Driven and Publish-Subscribe Protocol
Middleware and Protocol Selection Criteria
- Latency requirements
- Scalability
- Security needs
- Data consistency
Naming and Addressing
- Naming and addressing are critical components of distributed systems, enabling nodes to identify and communicate with each other.
- Naming involves assigning a unique identifier (e.g., name or ID) to each node or resource.
- Addressing consists of assigning a unique address, like an IP address, to each node or resource.
Common Naming and Addressing Schemes
- Domain Name System (DNS) is a hierarchical naming system that enables nodes to resolve domain names to IP addresses.
- Uniform Resource Locator (URL) is a naming scheme that enables nodes to identify resources on the web.
Synchronization and Concurrency Control
- Synchronization and concurrency control ensure that multiple nodes can access shared resources safely and efficiently.
- Synchronization involves coordinating the actions of multiple nodes to ensure consistent and predictable access to shared resources.
- Concurrency control manages multiple requests to shared resources, ensuring that only one node can access the resource at a time.
Locks
- Locks are mechanisms that enable nodes to acquire exclusive access to shared resources.
- A lock mechanism allows only one process or thread to access a shared resource at a time.
Lock Acquisition Process:
- Lock Acquisition: A process requests a lock on a shared resource.
- Lock Granting: If the lock is available, it is granted to the requesting process.
- Resource Access: The process acquires a lock and can now access the shared resource.
- Lock Release: When the process finishes accessing the resource, it releases the lock.
Types of Locks:
- Exclusive locks (X-locks): only one process can hold an X-lock on a resource at a time.
- Shared locks (S-locks): multiple processes can hold an S-lock on a resource at a time.
Challenges and Limitations of Locks
- Deadlocks: two or more processes can wait indefinitely for each other to release a lock.
- Starvation: a process may be unable to access a shared resource due to continuous lock acquisition by other processes.
- Performance overhead: Lock acquisition and release can generate significant overhead.
- Lock timeouts and lock escalation techniques are introduced to overcome these challenges
Semaphores
- A semaphore is a variable that controls access to a shared resource by multiple processes.
Semaphore Operations:
- P-operation: decrements the semaphore value; if the value is already zero, the process is blocked until the value becomes positive.
- V-operation: increments the semaphore value; if there are blocked processes, one of them is unblocked.
Semaphore States:
- Available (semaphore value > 0): the resource is available and can be accessed.
- Busy (semaphore value == 0): the resource is busy, and processes are blocked from accessing it.
- Blocked (semaphore value < 0): processes are blocked, waiting for semaphore value to become positive.
Distributed System Models
- Distributed systems support critical technologies such as cloud platforms, blockchain networks, and large-scale web services.
- Designing and managing these systems come with challenges related to concurrency, partial failures, unpredictable communication delays, and heterogeneous components.
- A distributed system model is an abstract framework that simplifies reasoning about system behavior, trade-offs, and solutions.
Client-Server Model
- Based on a request/reply protocol implemented with send and receive or Remote Procedure Calls(RPC) or Remote Method Invocation(RMI).
- A client sends a request message to the server.
- The server performs the work and returns the result or an error code
- A server may require services from other servers.
Key Features of the Client-Server Model
- Centralized control
- Asymmetric roles
- Scalability
Advantages of the Client-Server Model
- Simplicity in design and management.
- Strong access control and security .
- Easier maintenance of consistency
Disadvantages of the Client-Server Model
- Single point of failure
- Bottlenecks under high load
- Network latency for geographically distant clients from the server.
Use Cases f the Client-Server Model
- Traditional web applications
- Centralized databases
- Enterprise systems with access controls
Peer-to-Peer Models
- General and flexible framework
- All objects/processes have a similar role
- Objects or processes interact without any particular link between clients and servers.
- A large number of data files are transferred and a home computer has a tiny place in the database.
- Distributed share resources widely.
Key Features Peer-to-Peer Models
- Equal stakeholders
- Peer-to-peer are self-organized
- Flexible support for shared resources
Advantages of Peer-to-Peer Models
- No point of failure
- Improves scale as capacity increases
- Cost effective. Leverages remaining power
Disadvantages of Peer-to-Peer Models
- Compexity coordinating discovery
- Security risks such as Sybil attacks
- Data can be outdated and fragmented
Use Cases Peer-to-Peer Models
- Sharing networks
- Decentralized applications
- Collaborative applications
Publisher/Subscriber (Pub/Sub) Model
- A messaging pattern used in software architecture to facilitate asynchronous communication between different/ same systems.
- In this model, the messages sent are then transfered for each user.
Entities of Pub/Sub Model
- Publishers send and create messages
- Consumers utilize and acquire messages
- Topics use channels for certain types of messages
- Intermediate are Message Brokers, routing messages between subscribers and publishers
Characteristics of Pub/Sub Model
- Asynchronous communications
- Classifying messages by target
- The high throughput
Advantages of Pub/Sub Model
- Uncoupled by operating alone
- Live messaging distribution through loT
- The larger scale manages the number of streams by shared brokers
Disadvantages of Pub/Sub Model
- Prone to failure
- Message can be over-sent
- Subscriptions need back pressure
Use Cases of Pub/Sub Model
- Analytics in real-time
- Networks that are smart
- Support for driven message
Trade-offs and Design Choices
- Client and server environments are stable
- P2P provides safety from faulty blockchains
- The real time messages are pushed out via this structure
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.