Distributed Systems: Design and Architecture

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

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?

  • 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?

  • 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?

<p>Fault Tolerance (A)</p>
Signup and view all the answers

Why is decentralization a key principle in distributed systems design?

<p>To avoid single points of failure and bottlenecks (A)</p>
Signup and view all the answers

How does the flexibility principle influence the architecture of distributed systems?

<p>By allowing adaptation to different hardware, software, and network configurations (A)</p>
Signup and view all the answers

What is the defining characteristic of client-server architecture in distributed computing?

<p>Multiple nodes requesting services from a central system (C)</p>
Signup and view all the answers

In a client-server architecture, which component is responsible for processing requests and responding accordingly?

<p>The server (A)</p>
Signup and view all the answers

Within the context of client-server architecture, what role does the network play?

<p>It is the communication medium that connects clients and servers. (A)</p>
Signup and view all the answers

In a three-tier architecture, what distinguishes the application server from the database server?

<p>The application server processes business logic, while the database server manages data. (C)</p>
Signup and view all the answers

What is a significant limitation of client-server architecture concerning data availability?

<p>A server crash can result in data loss for all clients. (A)</p>
Signup and view all the answers

Which of the following scenarios accurately describes a real-life application of client-server architecture?

<p>A web browser requesting a webpage from a server. (A)</p>
Signup and view all the answers

Within a peer-to-peer (P2P) architecture, what is the most distinguishing characteristic of the nodes?

<p>All nodes are equal, acting as both clients and servers. (D)</p>
Signup and view all the answers

What is a key property of P2P architecture regarding authority and control?

<p>Decentralized with no central authority (D)</p>
Signup and view all the answers

How does the self-organization characteristic manifest in P2P networks?

<p>Through the dynamic joining and leaving of peers in the network (A)</p>
Signup and view all the answers

What is the primary advantage of P2P systems in terms of scalability compared to client-server systems?

<p>P2P systems can scale more effectively because each peer contributes resources to the network. (C)</p>
Signup and view all the answers

How does P2P architecture enhance fault tolerance compared to traditional client-server models?

<p>By allowing other peers to take over responsibilities of failed peers (C)</p>
Signup and view all the answers

What is a significant security risk inherent in P2P architectures?

<p>Increased vulnerability due to varying security configurations among peers (A)</p>
Signup and view all the answers

In the context of P2P architecture, what distinguishes unstructured P2P networks?

<p>The absence of a centralized index of resources (D)</p>
Signup and view all the answers

How do structured P2P networks, such as Chord, index resources?

<p>Through a distributed hash table (DHT) (A)</p>
Signup and view all the answers

Which P2P model combines elements of both unstructured and structured P2P networks?

<p>Hybrid P2P (D)</p>
Signup and view all the answers

What is the role of middleware in distributed systems?

<p>To act as an intermediary enabling communication and data exchange between applications (A)</p>
Signup and view all the answers

How does middleware simplify the development of distributed applications?

<p>By allowing developers to focus on application logic rather than underlying communication protocols (D)</p>
Signup and view all the answers

Within the functions of middleware, what is the purpose of message queuing?

<p>To ensure asynchronous communication between components (A)</p>
Signup and view all the answers

Which type of middleware is specifically designed to enable distributed objects to communicate with each other?

<p>Object-oriented middleware (A)</p>
Signup and view all the answers

Which of the following exemplifies database middleware?

<p>ODBC (B)</p>
Signup and view all the answers

In the context of distributed systems, what do communication protocols primarily define?

<p>The rules and formats for data exchange between nodes (D)</p>
Signup and view all the answers

What is the role of the Domain Name System (DNS) in distributed systems?

<p>To enable nodes to resolve domain names to IP addresses (D)</p>
Signup and view all the answers

What mechanisms ensure that multiple nodes can access shared resources safely and efficiently?

<p>Synchronization and concurrency control (C)</p>
Signup and view all the answers

What is the purpose of concurrency control in distributed systems?

<p>To ensure that only one node can access a shared resource at a time (C)</p>
Signup and view all the answers

What is a key characteristic of exclusive locks (X-locks) in concurrency control?

<p>Only one process can hold an X-lock on a resource at a time. (D)</p>
Signup and view all the answers

What potential issue can deadlocks cause?

<p>Processes waiting indefinitely for each other to release locks (B)</p>
Signup and view all the answers

What describes the state of semaphore where the shared resource is available and can be accessed?

<p>Availabile (semaphone value &gt; 0) (D)</p>
Signup and view all the answers

Flashcards

Distributed System

A collection of independent computers appearing as a single, cohesive system, working through a network to achieve a common goal.

Scalability

The ability of a system to handle increased demand by adding more nodes horizontally.

Fault Tolerance

The system's ability to continue functioning, even if nodes fail.

Decentralization

The design principle to avoid any single points of failure or bottlenecks.

Signup and view all the flashcards

Transparency

Providing a seamless user experience by hiding the underlying complexities of the distributed architecture.

Signup and view all the flashcards

Flexibility

Designing systems to accommodate different hardware, software, and network configurations.

Signup and view all the flashcards

Client-Server Architecture

A computing concept involving multiple nodes (clients) requesting services from a central system (server).

Signup and view all the flashcards

Client

The requesting entity in client-server architecture, initiating communication to request services or data from a server.

Signup and view all the flashcards

Server

The providing entity in client-server architecture, offering services, resources, or data upon client request.

Signup and view all the flashcards

Network

The communication medium connecting clients and servers, like LAN or WAN(Internet).

Signup and view all the flashcards

Two-Tier Architecture

An architecture where the client directly communicates with the server.

Signup and view all the flashcards

Multi-Tier Architecture

An architecture involving clients, application servers, and database servers for large-scale cloud applications.

Signup and view all the flashcards

Peer-to-Peer Architecture

A distributed system architecture where all nodes (peers) are equal, acting as both clients and servers to share resources.

Signup and view all the flashcards

All peers are equal

P2P characteristic of equality; all nodes have the same capabilities and responsibilities.

Signup and view all the flashcards

Decentralized

P2P characteristic where there's no central coordinating entity or authority.

Signup and view all the flashcards

Autonomous

P2P characteristic in which peers operate independently.

Signup and view all the flashcards

Middleware

Software that acts as an intermediary between applications, enabling communication, data exchange, and coordination.

Signup and view all the flashcards

Inter-process communication

Facilitates communication between different processes across networks.

Signup and view all the flashcards

Remote procedure calls

Enables function/method execution across different machines.

Signup and view all the flashcards

Message queuing

Ensures asynchronous communication between components using message queues.

Signup and view all the flashcards

Security and authentication

Manages access control and encryption.

Signup and view all the flashcards

Load balancing

Distributes workload across multiple servers for efficiency.

Signup and view all the flashcards

Message-oriented middleware

Uses message queues or asynchronous communication, such as Apache Kafka or RabbitMQ.

Signup and view all the flashcards

Object-oriented middleware

Enables distributed objects to communicate, like CORBA.

Signup and view all the flashcards

Communication Protocols

Communication protocols define the rules and formats for data exchange between nodes.

Signup and view all the flashcards

TCP

A transport layer protocol focused on reliable, ordered, and error-checked delivery of a stream of bytes

Signup and view all the flashcards

UDP

A transport layer protocol that provides a connectionless service, with minimal protocol mechanism

Signup and view all the flashcards

HTTP/HTTPS

Used in web-based distributed systems.

Signup and view all the flashcards

MQTT

For IoT applications.

Signup and view all the flashcards

RPC

Allows calling procedures on remote systems.

Signup and view all the flashcards

Websocket

Enables real-time bidirectional communication in web applications

Signup and view all the flashcards

Naming

Assigning a unique identifier, such as a name or ID, to nodes or resources.

Signup and view all the flashcards

Addressing

Assigning a unique address, such as an IP address, to nodes or resources.

Signup and view all the flashcards

Synchronization in Distributed Systems

Ensuring multiple nodes can access shared resources safely and efficiently.

Signup and view all the flashcards

Synchronization

Coordinating actions to ensure nodes access shared resources consistently and predictably.

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.

Quiz Team

Related Documents

More Like This

Distributed Systems Architectures
30 questions
Client-Server Architecture
20 questions

Client-Server Architecture

EnergySavingAmbiguity9661 avatar
EnergySavingAmbiguity9661
Introduction to Distributed Systems
24 questions
Use Quizgecko on...
Browser
Browser