0% found this document useful (0 votes)
26 views

Distributed 1

Assignment

Uploaded by

jhk2ghhqqz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Distributed 1

Assignment

Uploaded by

jhk2ghhqqz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 11

Wolaita Sodo University

School Of Informatics

CS Department

Course Name : Introduction to Distributed System

Assignment-1

Name : Nebiyu Tekle

ID : cs/we/133/12

1. Explain distributed system.

A distributed system is a network of independent computers that work


together to achieve a common goal. These computers are connected through a
communication network and share resources such as data, processing power,
and storage. Distributed systems are designed to improve performance,
reliability, and scalability by distributing the workload across multiple
machines.

In a distributed system, tasks are divided among the different machines,


allowing for parallel processing and efficient resource utilization. This can
lead to improved performance and faster response times compared to a single,
centralized system. Additionally, distributed systems are more resilient to
failures, as tasks can be rerouted to other machines if one machine fails.

Examples of distributed systems include cloud computing platforms, peer-to-


peer networks, and distributed databases. These systems are used in a wide
range of applications, including web services, social networks, and scientific
research.

2. Explain more briefly the goals of distributed


system.

The goals of distributed systems include:

Scalability: Distributed systems should be able to handle an increasing


number of users, data, and requests by adding more machines or resources.

Reliability: Distributed systems should continue to operate even if


individual components fail, ensuring that the system remains available and
functional.

Performance: Distributed systems should be able to efficiently process


tasks and requests by distributing the workload across multiple machines.

Flexibility: Distributed systems should be able to adapt to changing


requirements and environments, allowing for easy integration of new
components or services.

Security: Distributed systems should protect data and resources from


unauthorized access, ensuring the confidentiality, integrity, and availability of
information.

Fault tolerance: Distributed systems should be able to recover from


failures and errors without affecting the overall operation of the system.

3. Explain the types of distributed systems,


scaling techniques and cluster types in DS.
Types of Distributed Systems:

Client-Server Architecture: In a client-server architecture, clients


request services or resources from servers. This model is commonly used in
web applications where the client (browser) interacts with a server (web
server) to retrieve web pages or data.

Peer-to-Peer (P2P) Architecture: In a peer-to-peer architecture, all


nodes in the network can act as both clients and servers, sharing resources
and information directly with each other without the need for a centralized
server. P2P networks are commonly used for file sharing and content
distribution.

Distributed Computing Systems: These systems involve multiple


computers working together to solve complex computational problems or
process large datasets. Examples include Hadoop for distributed data
processing and MapReduce for parallel computation.

Scaling Techniques in Distributed Systems:

Horizontal Scaling: Also known as scaling out, horizontal scaling


involves adding more machines or nodes to distribute the workload across
multiple servers. This approach helps increase the system's capacity and
performance by handling more requests in parallel.
Vertical Scaling: Also known as scaling up, vertical scaling involves
increasing the resources (CPU, memory, storage) of individual machines to
handle larger workloads. While vertical scaling can improve performance, it
has limitations in terms of scalability compared to horizontal scaling.

Cluster Types in Distributed Systems:

High Availability (HA) Clusters: HA clusters are designed to provide


continuous availability of services by automatically failing over to a backup
node in case of a failure. This ensures that the system remains operational
even if one node goes down.

Load Balancing Clusters: Load balancing clusters distribute incoming


requests across multiple nodes to evenly distribute the workload and prevent
any single node from becoming overloaded. This helps improve performance
and scalability by utilizing resources efficiently.

Data Replication Clusters: Data replication clusters replicate data


across multiple nodes to ensure data durability and availability. This
approach helps prevent data loss and improves fault tolerance by storing
multiple copies of data on different nodes.

4. Explain types of middleware and their


architectures in DS.

Types of Middleware in Distributed Systems:


Message-Oriented Middleware (MOM): Message-oriented
middleware facilitates communication between distributed components by
enabling asynchronous messaging. It allows applications to send and receive
messages independently of each other, ensuring reliable message delivery and
decoupling of sender and receiver.

Remote Procedure Call (RPC) Middleware: RPC middleware


enables distributed applications to call procedures or functions on remote
systems as if they were local. It abstracts the complexities of network
communication, allowing developers to interact with remote services
seamlessly.

Object Request Broker (ORB): ORB middleware facilitates


communication between distributed objects by providing a mechanism for
remote method invocation and object interaction. It enables objects in
different locations to interact transparently as if they were local objects.

Data Access Middleware: Data access middleware provides a


standardized interface for accessing and manipulating data stored in
distributed databases or data sources. It abstracts the underlying data storage
mechanisms, allowing applications to access data regardless of its location.

Middleware Architectures in Distributed Systems:

Client-Server Architecture: In a client-server architecture, middleware


acts as an intermediary between clients and servers, facilitating
communication and data exchange. The middleware component can handle
tasks such as request routing, data transformation, and security enforcement.

Broker Architecture: In a broker architecture, middleware components


called brokers act as intermediaries that coordinate communication between
distributed components. Brokers can handle message routing, data
transformation, and service discovery to enable seamless interaction between
components.

Layered Architecture: In a layered architecture, middleware


components are organized into layers that provide different levels of
abstraction and functionality. Each layer performs specific tasks such as
communication, data transformation, or security enforcement, enabling
modular and scalable design of distributed systems.

Publish-Subscribe Architecture: In a publish-subscribe architecture,


middleware components enable publishers to send messages to subscribers
based on predefined topics or channels. The middleware handles message
distribution, subscription management, and event notification, allowing
decoupled communication between components.

5. Explain the following terms:


a. Threads
b. Process
c. Multithreads
d. Threads and processes in distributed system
e. Context switching
f. Multithreaded server

Threads: Threads are the smallest unit of execution within a process. They
allow a program to perform multiple tasks concurrently by dividing the
processing workload into smaller units that can be executed independently.
Threads within the same process share resources such as memory and file
handles, but each thread has its own stack and program counter.
Process: A process is an instance of a running program on a computer
system. It consists of the program code, data, and resources required for
execution. Each process has its own memory space, file descriptors, and other
system resources. Processes are isolated from each other and communicate
through inter-process communication mechanisms.

Multithreading: Multithreading is a programming technique where


multiple threads within the same process run concurrently to achieve
parallelism and improve performance. Multithreading allows different parts
of a program to execute simultaneously, enabling tasks to be performed in
parallel and making efficient use of system resources.

Threads and processes in distributed systems: In distributed


systems, threads and processes play a crucial role in enabling concurrent
execution and communication between distributed components. Processes can
run on different nodes in a distributed system, while threads within a process
can handle communication, data processing, and other tasks in parallel across
distributed nodes.

Context switching: Context switching is the process of saving the state of


a thread or process that is currently running, then restoring the state of
another thread or process to continue execution. Context switching is
necessary for multitasking and multiprogramming systems to efficiently
switch between different tasks and maintain system responsiveness.

Multithreaded server: A multithreaded server is a server application


that uses multithreading to handle multiple client requests concurrently. Each
client connection is typically handled by a separate thread, allowing the server
to serve multiple clients simultaneously. Multithreaded servers are commonly
used in distributed systems to improve scalability and responsiveness by
leveraging parallelism.

6. Explain statefull and stateless servers


Stateful servers and stateless servers are two different approaches to
managing client-server interactions in a networked environment. Here is an
explanation of each:

Stateful Servers:
· Stateful servers maintain the state or context of client interactions
throughout the duration of a session. This means that the server keeps
track of client-specific information, such as session data, user
preferences, transaction history, etc.

· In a stateful server architecture, the server stores client state


information either in memory or in a database. This allows the server to
provide personalized responses and maintain continuity in client
interactions.

· Stateful servers typically require more resources to manage and store


client state information, but they can offer more flexibility and
customization in handling client requests.

· Examples of stateful servers include online gaming servers that track


player progress, e-commerce websites that store shopping cart contents,
and messaging applications that maintain chat histories.

Stateless Servers:
· Stateless servers do not store any client-specific state information
between requests. Each client request is treated as an independent and
self-contained transaction, with no dependency on previous requests.

· In a stateless server architecture, the server processes each request


based solely on the information provided in that request. Once the
response is sent back to the client, the server does not retain any
information about the client or the request.
· Stateless servers are more scalable and easier to manage because they
do not need to store and manage client state information. They are also
more fault-tolerant since there is no risk of data corruption or
inconsistencies due to server crashes.

· However, stateless servers may require clients to include all necessary


information in each request, which can result in larger request payloads
and potentially slower performance for certain types of applications.

· Examples of stateless servers include RESTful web services that use


HTTP requests for communication, microservices architectures that
emphasize independence and scalability, and cloud-based applications
that prioritize horizontal scaling.

7. Explain Code Migration in distributed


system.

Code migration in a distributed system refers to the process of moving or


transferring code from one node or server to another within the distributed
environment. This can be done for various reasons, such as load balancing,
fault tolerance, performance optimization, or software updates. Here is an
explanation of code migration in distributed systems:

Load Balancing:
· Code migration can be used for load balancing purposes in a distributed
system. When a particular node or server becomes overloaded with
requests, the system can dynamically migrate code (or processes) to
other nodes that have available resources to handle the workload more
efficiently.

· By redistributing the workload across multiple nodes through code


migration, the system can achieve better resource utilization and
improve overall performance.

Fault Tolerance:
· Code migration can also be used for fault tolerance in distributed
systems. If a node or server fails or becomes unresponsive, the system
can migrate the code running on that node to another healthy node to
ensure continuous operation and prevent service disruptions.

· By dynamically migrating code in response to failures, the system can


maintain high availability and reliability even in the presence of
hardware or software failures.

Performance Optimization:
· Code migration can help optimize performance in distributed systems
by moving code closer to the data it operates on or reducing network
latency between components. For example, if a particular computation
requires access to a specific dataset stored on a different node, the
system can migrate the code to that node to minimize data transfer
overhead.

· By strategically migrating code to where it can be executed most


efficiently, the system can reduce processing delays and improve overall
performance.

Software Updates:
· Code migration is often used for deploying software updates or patches
in distributed systems. Instead of taking the entire system offline for
maintenance, the system can migrate code to different nodes
sequentially, ensuring that the service remains available during the
update process.
· By migrating code in a controlled manner, the system can minimize
downtime and disruptions caused by software updates while
maintaining continuous service availability

You might also like