Design Analysis and Algorithm 2024-2025
Design Analysis and Algorithm 2024-2025
BY
DR. CHITRANGADA CHAUBEY
ASSISTANT PROFESSOR
CSE & ALLIED SPECIALIZED BRANCHES
UNIT- II
• Efficient maintenance: It’s easier to create, update, and debug small services
than large code blocks in monolithic applications. Modifying any service in
SOA does not impact the overall functionality of the business process.
• Service implementation: The service implementation is the code that builds the logic for
performing the specific service function, such as user authentication or bill calculation.
• Service contract: The service contract defines the nature of the service and its associated
terms and conditions, such as the prerequisites for using the service, service cost, and
quality of service provided.
• Service interface : In SOA, other services or systems communicate with a service through
its service interface. The interface defines how you can invoke the service to perform
activities or exchange data. It reduces dependencies between services and the service
requester. For example, even users with little or no understanding of the underlying code
logic can use a service through its interface.
Components of service-oriented architecture
2. Service provider
The service provider creates, maintains, and provides one or more services that
others can use. Organizations can create their own services or purchase them from
third-party service vendors.
3. Service consumer
The service consumer requests the service provider to run a specific service. It can
be an entire system, application, or other service. The service contract specifies the
rules that the service provider and consumer must follow when interacting with
each other. Service providers and consumers can belong to different departments,
organizations, and even industries.
4. Service registry
A service registry, or service repository, is a network-accessible directory of available
services. It stores service description documents from service providers. The
description documents contain information about the service and how to
communicate with it. Service consumers can easily discover the services they need
by using the service registry.
How does service-oriented architecture work
• In service-oriented architecture (SOA), services function independently and provide
functionality or data exchanges to their consumers. The consumer requests information
and sends input data to the service. The service processes the data, performs the task, and
sends back a response. For example, if an application uses an authorization service, it gives
the service the username and password. The service verifies the username and password
and returns an appropriate response.
• Communication protocols
Services communicate using established rules that determine data transmission over a
network. These rules are called communication protocols. Some standard protocols to
implement SOA include the following:
• Simple Object Access Protocol (SOAP)
• RESTful HTTP
• Apache Thrift
• Apache ActiveMQ
• Java Message Service (JMS)
Limitations of implementing service-oriented architecture
• Limited scalability : System scalability is significantly impacted when services
share many resources and need to coordinate to perform their functionality.
• Single point of failure: For SOA implementations with an ESB, the ESB creates a
single point of failure. It is a centralized service, which goes against the idea of
decentralization that SOA advocates. Clients and services cannot communicate
with each other at all if the ESB goes down.
Web Services in Cloud Computing
• Web services are any software, applications, or cloud technologies that
connect, interact, and exchange data electronic messages using a
standardized Web protocol (HTTP or HTTPS). By transferring data over a web
service, programs written in many languages develop a connection between a
client and a server. A web service is accessed by a client who submits an XML
request, and the service returns an XML response.
How Do Web Services Work?
A description of how web services operate is provided below:
• By employing open protocols like HTML, XML, WSDL, and SOAP, web services serve as a
request-response pattern that facilitates communication with many applications.
• The expert co-op will respond with a reaction message if requested. Consequently,
there are two messages: a Request message (XML) and a Response message (XML). We
can create a web administration for Solaris that is built in Java and accessible from your
Visual Basic software, which sees a sudden increase in demand for Windows.
• An administration uses XML to label data, SOAP to transport messages, and WSDL to
show how accessible particular administrations are.
Components of Web Services
1. SOAP
• The acronym SOAP stands for Simple Object Access Protocol.
• A convention based on XML for accessing web services.
• W3C recommendation for application-to-application communication.
• Independent of both platforms and languages
2. UDDI
• Universal Description, Discovery, and Integration is referred to as UDDI.
• System based on XML.
• Information on web administrations
3. WSDL
• The acronym for WSDL is Web Services Description Language.
• It is an XML file.
• It contains information about web administrations, such as the name of the technology, the
strategy parameter, and directions to the site.
• It serves as a connection point for web administration software.
Features of Web Services
• XML-Based - Records are transported and represented using XML in web services.
Using XML eliminates the requirement for bindings on platforms, operating systems,
or networks. Web-based applications with a middle level of interactivity are
widespread.
• Loosely Coupled - An Internet service provider and the subscriber may only
sometimes be close to one another. A web service provider’s user interface might
evolve without impairing the user’s communication ability. Because the server’s and
mentor’s decisions are closely related to one another in a strongly coupled system,
both interfaces must be updated if one changes. Software systems are easier to
control and combine with other structures.
• Ability to be Synchronous or Asynchronous - Synchronization is the relationship
between the client and the function’s execution. The client can start a task while
working on other activities thanks to asynchronous operations. To continue using
synchronous invocation, the client must wait for the service to finish its operation, or
else it will be blocked. When the service is finished, synchronous clients receive their
results instantly, and asynchronous clients receive them later. Asynchronous abilities
are needed to enable loosely coupled systems.
Features of Web Services
• Coarse Grain - Object-oriented systems like Java have several ways of making their
services available, and corporate operations are too large for character techniques to be
effective. A Java application must be built from the ground up using various granular
strategies integrated to create a coarse grain provider used by the customer or
service. Corporations and the interfaces they provide should both be coarse-grained.
Constructing coarse-grained services with access to significant commercial enterprise
logic is simple by creating web services.
• Supports Remote Procedural Calls - Development of components across the company
EJBs (JavaBeans) and .NET elements has expanded in architectural and enterprise
deployments. Allocating and accessing them employ a variety of RPC strategies. A web
function can provide RPC by offering its services, much like a traditional role, or
converting incoming invocations into an EJB or .NET component invocation.
• Supports Document Exchanges - It is one of XML’s most appealing properties. The
Simple Object Access Protocol (SOAP) protocol is used for data exchange in web services.
It communicates through the internet and is platform, system, and language neutral. It
employs the Hypertext Transfer Protocol and the XML format. It transmits XML request
files and receives XML response files.
REST (REpresentational State Transfer)
• REST is an architectural style for developing web services and systems that can
easily communicate with each other. REST is popular due to its simplicity and the
fact that it builds upon existing systems and features of the internet's HTTP to
achieve its objectives, as opposed to creating new standards, frameworks and
technologies.
• It is popularly believed that REST is a protocol or standard. However, it is neither.
REST is an architectural style that is commonly adopted for building web-based
application programming interfaces (APIs).
• In this architectural style, systems interact through operations on resources.
Resources include all data and functionality. They are accessed using Uniform
Resource Identifiers (URIs) and acted upon using simple operations.
• Systems, service interfaces or APIs that comply with the REST architectural style
are called RESTful systems (or RESTful APIs). Typically, these applications are
lightweight, fast, reliable, scalable and portable.
REST (REpresentational State Transfer)
• REST is a software architectural style
that defines the constraints to create
web services. The web services that
follows the REST architectural style
is called RESTful Web Services. It
differentiates between the computer
system and web services. The REST
architectural style describes
the six barriers.
• HTTP Methods: Used to perform CRUD operations on resources (GET, POST, PUT,
DELETE).
• Status Codes: Indicate the status of a request (e.g., 200 OK, 404 Not Found).
REST Constraints
• It must have a uniform interface to simplify system architecture and improve the
visibility of interactions between system components.
• It must incorporate the client-server design pattern, allowing for the separation of
concerns and for the client and server implementations to be done independently.
• It must be stateless, meaning that the server and client don't need to know
anything about each other's state so they can both understand the messages
received from each other without having to see previous messages.
• It must be cacheable, meaning a response should label itself as cacheable or
noncacheable, and copies of frequently accessed data must be stored in
multiple caches along the request-response path.
• It must be layered to constrain component behavior, to remove the need to edit
code (on the client or server) and to improve the web app's security.
Advantages of REST
• Resource-based. REST enforces statelessness through resources rather than commands, improving
reliability, performance and scalability.
• Simple interface. In REST, each resource involved in client-server interactions is identified and is
uniformly represented in the server response to define a consistent and simple interface for all
interactions.
• Familiar constructs. REST interactions are based on constructs that are familiar to anyone
accustomed to using HTTP, including operations (GET, POST, DELETE, etc.) and URIs. That said,
REST and HTTP are not the same and developers must note the differences when implementing and
using REST.
• Communication. The status of REST-based interactions between the server and clients is
communicated through numerical HTTP status codes. REST APIs use the following HTTP status
codes to detect errors and ease the API monitoring process:
• 400 error indicates that the request cannot be processed due to a bad request.
• 404 error indicates that a requested resource wasn't found.
• 401 status response code is triggered by an unauthorized request.
• 200 status response code indicates that a request was successful.
• 500 error signals an unexpected internal server error.
Advantages of REST
• Language-independent. When creating RESTful APIs or web services, developers can employ any
language that uses HTTP.
• Widespread use. REST is widely used, making it a popular choice for numerous server- and client-
side implementations. For example, on the server side, developers can employ REST-based
frameworks like Restlet and Apache CXF, while on the client side, they can
employ jQuery, Node.js, Angular or Ember.js, and invoke RESTful web services using standard
libraries built into their APIs.
• Web APIs. RESTful services employ effective HTTP mechanisms for caching to reduce latency and
the load on servers.
• Separation of client and server. By providing many endpoints, a REST API makes it easy to create
complex queries that can meet specific deployment needs. Also, different clients hit the same REST
endpoints and receive the same responses if they use a REST interface, improving reliability and
performance.
• Resilience. In a REST system, the failure of a single connector or component does not result in the
entire system collapsing.
Disadvantages of REST
• Design limitations. There are some limitations of the REST architecture design. These
include multiplexing several requests over a single TCP connection, having different
resource requests for each resource file, server request uploads and long HTTP request
headers, which cause delays in webpage loading. Also, the freedom that REST provides
regarding design decisions can make REST APIs harder to maintain.
• Stateless applications. Because the server does not store state-based information
between request-response cycles, the client must perform state management tasks, which
makes it difficult to implement server updates without using client-side polling or other
types of webhooks that send data and executable commands between apps.
• Definition. REST lacks a clear reference implementation or a definitive standard to
determine whether a design can be defined as RESTful or whether a web API conforms to
REST-based principles.
• Data overfetching/underfetching. RESTful services frequently return large amounts of
unusable data along with relevant information -- typically the result of multiple server
queries -- increasing the time it takes for a client to return all the required data.
Publisher/Subscriber (pub/sub)Architecture
The Pub/Sub (Publisher/Subscriber) model is a messaging pattern used in
software architecture to facilitate asynchronous communication between
different components or systems. In this model, publishers produce
messages that are then consumed by subscribers.
Full Virtualization :
Para-virtualization :
The storage virtualization collects all the storage into a single pool from which
they can allocate to any of the VM on the network as required.
This step makes it easier for the hypervisor to assign storage for VMs with max
efficiency and without wasting any hardware resources from our system.
APPLICATION VIRTUALIZATION
In this virtualization process, the application runs
without the need of installing it into the system, as they
run on a virtual environment.
At the ISA level, virtualization is performed by emulating a given ISA by the ISA
of the host machine. For example, MIPS binary code can run on an x86-based
host machine with the help of ISA emulation.
With this approach, it is possible to run a large amount of legacy binary code
written for various processors on any given new hardware host machine.
• On the other hand, the process manages the underlying hardware through
virtualization. The idea is to virtualize a computer’s resources, such as its
processors, memory, and I/O devices.
• More recently, the Xen hypervisor has been applied to virtualize x86-based machines
to run Linux or other guest OS applications.
OPERATING SYSTEM LEVEL
• This refers to an abstraction layer between traditional OS and user
applications.
• OS-level virtualization creates isolated containers on a single physical server
and the OS instances to utilize the hard-ware and software in data centers.
• Most applications use APIs exported by user-level libraries rather than using lengthy system
calls by the OS.
• Since most systems provide well-documented APIs, such an interface becomes another
candidate for virtualization.
• Virtualization with library interfaces is possible by controlling the communication link
between applications and the rest of a system through API hooks.
• The software tool WINE has implemented this approach to support Windows applications on
top of UNIX hosts.
• Another example is the vCUDA which allows applications executing within VMs to leverage
GPU hardware acceleration.
APPLICATION LEVEL
• Application-level virtualization comes handy when you wish to virtualize only an application.
It does not virtualize an entire platform or environment.
• On an operating system, applications work as one process. Hence it is also known as process-
level virtualization.
• It is generally useful when running virtual machines with high-level languages. Here, the
application sits on top of the virtualization layer, which is above the application program.
• The application program is, in turn, residing in the operating system.
• Programs written in high-level languages and compiled for an application-level virtual
machine can run fluently here.
VIRTUAL MACHINE
A Virtual Machine (or VM) is an emulated environment of a physical computer system that
runs an operating system and applications.
A VM can be implement through software, firmware, hardware, or a combination. An
organization can have multiple VMs running different operating systems (OS) all stored on
one host machine that's monitored by a hypervisor.
• Virtualization Client Name: Name of the client computer that provides a management
access point for the hypervisor where the virtual machine is deployed.
• Virtual Machine Name: Name of the client computer for the virtual machine.
• Vendor: Hypervisor for the virtual machine.
• UUID : Universally unique ID (UUID) for the virtual machine.
• Hardware Version: The hardware version of the virtual machine on the host computer,
which determines the virtual hardware functions supported for the VM.
• Host: IP address for the host where the virtual machine is located.
• Host Version: Version and build for the hypervisor software on the host.
VIRTUAL MACHINE: ADVANTAGES
• Virtual machines are less efficient than real machines because they access the hardware
indirectly. Running software on top of the host operating system means that it will have to
request access to the hardware from the host. That will slow the usability.
• When several virtual machines are running on the same host, performance may be hindered if
the computer it’s running on lacks sufficient power. Your virtual machine still uses the resources
of your host machine. The more powerful the host computer, the more quickly the virtual
machine will run.
• A virtual machine can be infected with the weaknesses of the host machine. As an example,
process isolation is a feature usually employed by operating systems. However, there are bugs
that violate it. A regular computer devoid of virtual machines would then only be affected. But, a
computer with a number of virtual machines would then infect each of those “machines” as well.
HYPERVISOR
• A hypervisor is software that creates and runs virtual machines (VMs). A hypervisor, sometimes
called a virtual machine monitor/manager (VMM), isolates the hypervisor operating system and
resources from the virtual machines and enables the creation and management of those VMs..
• The physical hardware, when used as a hypervisor, is called the host, while the many VMs that use
its resources are guests.
• Types of Hypervisor
• TYPE I
• TYPE II
HYPERVISOR : TYPE - I
• A Type 1 hypervisor runs directly on the underlying computer’s physical hardware, interacting
directly with its CPU, memory, and physical storage. For this reason, Type 1 hypervisors are also
referred to as Bare-Metal Hypervisors or Native Hypervisor . A Type 1 hypervisor takes the place
of the host operating system.
• Often needs a separate management machine to administer different VMs and control the host
hardware.
• Large VMs are not supported
• Bad console interface
• Costlier
• Kernel-based Virtual Machine (KVM) is an open source virtualization technology built into
Linux. Specifically, KVM lets you turn Linux into a hypervisor that allows a host machine to
run multiple, isolated virtual environments called guests or virtual machines (VMs).
• KVM is part of Linux. If you’ve got Linux 2.6.20 or newer, you’ve got KVM. KVM was first
announced in 2006 and merged into the mainline Linux kernel version a year later. Because
KVM is part of existing Linux code, it immediately benefits from every new Linux feature, fix,
and advancement without additional engineering.
• Using KVM, one can run multiple virtual machines running unmodified Linux or Windows
images. Each virtual machine has private virtualized hardware: a network card, disk, graphics
adapter, etc.
KVM : FEATURES
• Over-committing : Which means allocating more virtualized CPUs or memory than
the available resources on the system.
• Disk I/O throttling : Provides the ability to set a limit on disk I/O requests sent
from virtual machines to the host machine.
• Virtual CPU hot add capability : It increases the capacity of processing power on
running virtual machines with no down time.
KVM : PROS & CONS
Advantages Disadvantages
• Super Low Cost • Complex Networking : One of the main
• Can interact directly with the Kernel. disadvantages of using KVM is the complex
setup process. It’s actually more complex
• Excellent Security : Since the base of KVM is than other systems.
made up of Linux, it uses the Linux advanced
security system. • Limited Processors : Another
disadvantage is the KVM virtualization is
• Available for Anybody to Use available only on certain processors and
• Most of the open source cloud automation not all.
software's use KVM as a default hyperviser. • CPU Virtualization Support :The
• Another advantage with KVM is that all disadvantage of the full virtualization like
applications should work exactly like in a KVM is that the -performance level can
dedicated server. reduce slightly compared to the Para-
virtualization.
• Uses its own kernel. Even the flexibility of
migrating from virtual machine to dedicated
server.
KVM : HOW DOES IT WORK?
• The KVM kernel module turns Linux kernel into a type 1 bare-metal hypervisor, while the overall
system could be categorized to type 2 because the host OS is still fully functional and the other
VM's are standard Linux processes from its perspective.
• KVM is built into Linux as an added functionality. It lets you convert the Linux kernel into a
hypervisor. It is sometimes confused with a type 2 hypervisor (see definition below). It has direct
access to hardware along with virtual machines it hosts. KVM is an open-source hypervisor that
contains all the features of Linux with the addition of many other functionalities.
• Hyper-V & KVM might look like type 2 while it is purely type 1.
HYPER-V
• Hyper-V is virtualization software that, well, virtualizes software. It can not only virtualize
operating systems but also entire hardware components, such as hard drives and network
switches. Unlike Fusion and Virtualbox, Hyper-V is not limited to the user’s device. You can
use it for server virtualization, too.
• Hyper-V Manager is an administrative tool which allows you to manage Hyper-V hosts and
virtual machines (VMs) both locally and remotely. Hyper-V Manager provides a graphical
user interface (GUI) for centralized management of Hyper-V virtual environments. Basically,
Hyper-V Manager is Microsoft's Management Console snap-in (.msc file), which is used by
Microsoft Windows to simplify the configuration and administration of Hyper-V systems.
HYPER-V
• Hyper-V, formerly named Windows Server Virtualization, is a hypervisor designed to create
virtual machines on x86-64 systems running Windows.
• A server computer that runs Hyper-V can be configured to expose individual virtual machines
to one or more networks.
• Hyper-V carries out the isolation of virtual machines in terms of a partition, a logical unit of
isolation that is supported by the hypervisor that each operating system executes in.
• The Hyper-V does not virtualize audio hardware, and does not require users to have an
existing installation of Windows Server 2008 or R2.
• The Hyper-V Server is built with components of Windows with an included Windows Server
Core user experience.
• Hyper-V specifically provides hardware virtualization. That means each virtual machine
runs on virtual hardware. Hyper-V lets you create virtual hard drives, virtual switches, and a
number of other virtual devices all of which can be added to virtual machines.
HYPER-V
Hyper-V features only available on Windows Server:
• Live migration of virtual machines from one host to another
• Hyper-V Replica
• Virtual Fiber Channel
• SR-IOV networking
• Shared .VHDX
Hyper-V features only available on Windows 10:
• Quick Create and the VM Gallery
• Default network (NAT switch)
HYPER-V : PROS & CONS
Hyper-V Pros Hyper-V Cons
• Cheaper than VMware • One user report that interacting with the
• Allows users to easily run a lot of VMs at host operating system was more
one time with dynamic memory challenging than using VSphere
management • Reported poor support for Linux
• Maintenance does not result in downtime operating systems
• Simple live migrations • Requires all VMs to be taken offline for a
reboot during routine security updates to
• Easy backups OS
• Comprehensive security through Active • Some users do not like the extremely
Directory minimalist administrator interface
VIRTUALBOX
Oracle VM VirtualBox is a free and open-source hosted hypervisor for x86 computers and is
under development by Oracle Corporation.
Oracle virtualbox is a software which allow users to run multiple operating system in a single
machine and to freely switch between OS instances running simultaneously. It can create and
manage guest virtual machine each with a guest operating system and its own virtual
environment.
Virtualbox is a software which can run all the types of OS(Operating System).
• Virtual Machine is eligible to run :-
• Linux Based OS
• Windows Based OS
• Solaris Based OS
• IDM Based OS,etc
VIRTUALBOX: DISADVANTAGES
• High CPU and Memory Utilization. Even when running on more than capable hardware, Oracle
VM VirtualBox uses and excessive amount of resources, slowing the host OS down.
• Poor 3D Graphics Support. The amount of settings and features related to enhancing graphics in
general is fairly limited for VirtualBox.
• PCIe Passthrough functionality is quite buggy. Many other alternatives have fully implemented
this, but VirtualBox has yet to do so.
VIRTUALBOX: ADVANTAGES
• Running multiple operating systems simultaneously. Oracle VM VirtualBox enables you to
run more than one OS at a time.
• Easier software installations. Software vendors can use virtual machines to ship entire
software configurations. For example, installing a complete mail server solution on a real
machine can be a tedious task. With Oracle VM VirtualBox, such a complex setup, often called
an appliance, can be packed into a virtual machine.
• Oracle VM VirtualBox imposes no limits on the number of snapshots you can take. The only
practical limitation is disk space on your host. Snapshots" is a feature of "Oracle
VM VirtualBox" that allows you to save and then revert back to the exact state of a virtual
machine.
• Testing and disaster recovery. Once installed, a virtual machine and its virtual hard disks
can be considered a container that can be arbitrarily frozen, woken up, copied, backed up, and
transported between hosts.
• Infrastructure consolidation. Virtualization can significantly reduce hardware and
electricity costs.