CC Unit 2 R23 Lecture Notes
CC Unit 2 R23 Lecture Notes
CLOUD COMPUTING
UNIT – II
Amazon Web Services (AWS): This is a comprehensive, broadly adopted, and leading cloud
platform offered by Amazon. It provides a vast array of services, including computing power (e.g.,
EC2 for virtual machines), storage (e.g., S3 for object storage), databases, analytics, machine
learning, networking, mobile, developer tools, and more. AWS is a prime example of a public cloud
offering Infrastructure as a Service (IaaS) and many other service models.
Google App Engine: This is a Platform as a Service (PaaS) offered by Google Cloud. It allows
developers to build and host web applications on Google's scalable infrastructure without managing
the underlying servers. It supports various programming languages and automatically scales
applications based on demand.
Microsoft Azure: This is Microsoft's cloud computing platform, similar to AWS and Google Cloud.
Azure offers a wide range of services, including IaaS (virtual machines, networking), PaaS (app
services, databases), and Software as a Service (SaaS) offerings. It caters to a broad spectrum of
computing needs, from simple web hosting to complex enterprise solutions.
Hadoop: This is an open-source framework for distributed storage and processing of large datasets
across clusters of computers. It's not a cloud service provider itself, but rather a foundational
technology for big data analytics. Key components include HDFS (Hadoop Distributed File
System) for storage and MapReduce for processing. Many cloud providers offer managed Hadoop
services.
Manjrasoft Aneka: This is a PaaS (Platform as a Service) software framework that allows
developers to build and deploy distributed applications on private or hybrid clouds. It focuses on
providing a flexible environment for parallel and distributed programming, supporting various
programming models (like Bag of Tasks, MapReduce). Aneka aims to simplify the development and
deployment of applications that can leverage the power of cloud computing environments.
Ubiquitous Internet
“Ubiquitous Internet” means that internet connectivity is available anytime, anywhere, and
on any device.
• Ubiquitous = present everywhere
• So, users, devices, and applications can seamlessly connect to services without
location constraints.
• Ubiquitous Internet = The backbone that connects users and devices to the cloud
anytime, anywhere.
Without ubiquitous Internet, cloud computing loses its core value proposition of on-demand,
location-independent, device-agnostic services.
Page 2
Example Use Case
A company uses a SaaS CRM (like Salesforce).
Sales teams in different countries can log in anytime.
Managers can get real-time dashboards on their phones.
Data syncs seamlessly because of ubiquitous connectivity.
The Ubiquitous Internet is a fundamental enabler of cloud computing because it:
Connects users to cloud services:
Users can access data, apps, and infrastructure hosted in the cloud from anywhere.
Example: Accessing Google Drive, Office 365, or AWS from a laptop, tablet, or
phone.
Facilitates on-demand resources:
Cloud computing relies on delivering resources (compute, storage, applications) over
the Internet.
The always-available Internet makes this possible for globally distributed users.
Supports multi-device access:
One user can switch between devices (laptop → tablet → smartphone) and still
access the same cloud services.
Enables edge and IoT integration:
Smart devices and IoT sensors use ubiquitous connectivity to send data to the cloud
for processing and analytics.
Benefits of Ubiquitous Internet in Cloud Computing:
Accessibility: 24/7 availability of services and data.
Scalability: Cloud providers can serve millions of users globally.
Flexibility: Work and collaborate from any location.
Cost-effectiveness: Organizations don’t need on-premises infrastructure for remote
workers.
Innovation: Enables new apps like smart cities, connected vehicles, and real-time
collaboration tools.
Page 3
Two Fundamental Computing Eras
• Sequential Era (1940s onwards)
• Dominated by single-processor (sequential) computing.
• Executing instructions one at a time in a specific order.
• A single processor handles one task at a time
• Drawbacks: performance limitations and lack of scalability
o lower processing speeds for complex tasks, a bottleneck when dealing
with parallelizable operations, and vulnerability to system failure due
to a single point of failure.
• Parallel Era (1950s onwards)
• Emerged to overcome limitations of sequential processing.
o Enhancing speed, efficiency, and scalability for complex tasks
o By dividing workloads across multiple processors, parallel computing
can significantly reduce processing time, handle larger datasets, and
improve overall system performance.
• Includes parallel and distributed computing.
• Using multiple processors/cores/nodes to solve larger, more complex
problems.
Parallel Computing:
Computation is divided into tasks that execute simultaneously on multiple processors sharing the
same memory.
Key features:
Tightly coupled: Processors communicate via shared memory.
Homogeneous processors: Same type and capability.
Single address space: All processors access the same memory.
Classic example:
A multi-core CPU running a parallel algorithm, or a supercomputer with shared memory nodes.
Modern example:
Clusters with distributed shared memory via high-speed interconnects (e.g., InfiniBand).
Goal: Achieve high performance through concurrency within a single, often physically unified
system.
Distributed Computing:
Computation is divided into tasks executed concurrently on different computing elements — which
may or may not share memory, and are often in different physical locations.
Page 4
Key features:
Loosely or tightly coupled: Can range from clusters to globally distributed systems.
Heterogeneous: Nodes can differ in hardware/software.
Communication: Nodes communicate via messages over a network.
Classic examples:
o Computing grids (e.g., SETI@home)
o Internet-based distributed systems
o Cloud computing (public cloud data centers are large distributed systems).
Goal: Aggregate distributed resources to solve large problems collaboratively.
Parallel computing helps overcome the speed limits of single processors by horizontally
scaling — using many processors in parallel to achieve higher performance for complex
problems.
Page 5
Connect multiple processors that work in coordination to solve “Grand Challenge” problems
(complex problems needing massive computing power).
Instead of doing everything sequentially, tasks are broken into parts that run simultaneously
(parallelism).
Parallel computing is the field that covers:
Techniques — How to split and manage tasks in parallel.
Architectures — The hardware setups (multi-core processors, multiprocessor
systems) that make it possible.
Systems — The tools and environments that support parallel execution and
coordination.
Page 6
Hardware architectures for parallel processing:
The core elements of parallel processing are CPUs. Based on the number of instruction and data
streams that can be processed simultaneously, computing systems are classified into the following
four categories:
• Single-instruction, single-data (SISD) systems
• Single-instruction, multiple-data (SIMD) systems
• Multiple-instruction, single-data (MISD) systems
• Multiple-instruction, multiple-data (MIMD) systems
Note:
The instruction stream is the sequence of instructions fetched from memory and executed.
The data stream is the flow of data (operands, results) between the CPU and memory.
The CPU fetches instructions from the instruction stream, and those instructions operate on
the data within the data stream.
1. SISD systems:
Instruction Stream:
One set of instructions flows to the processor.
Data Input:
One stream of input data feeds the processor.
Processor:
The single processor executes one instruction at a time on the data.
Data Output:
Results are output sequentially.
The SISD model is the simplest computer architecture — a single processor working on one
task at a time, processing a single data stream sequentially.
This is why classic computers are often called sequential computers.
SISD stands for Single-Instruction, Single-Data:
A single processor executes one instruction at a time on one data stream.
This is the classical sequential computing model.
Page 7
Key features:
Sequential execution: Instructions are processed one after another, no parallelism.
Memory: All instructions and data must be stored in primary memory.
Performance limit: Speed depends on how fast the system can transfer information internally
(CPU speed, memory bandwidth, bus speed).
Common examples: Traditional PCs (e.g., IBM PC), Macintoshes, and standard workstations.
2. SIMD Systems:
SIMD systems use multiple processors to execute the same instruction on different data
elements at the same time, making them perfect for data-parallel tasks like vector/matrix
operations.
SIMD stands for Single-Instruction, Multiple-Data:
It’s a multiprocessor system where the same instruction is executed simultaneously
on multiple data streams.
The same control unit broadcasts one instruction to all processing elements, but each
works on its own piece of data.
Examples of SIMD systems
Cray vector processors — famous for high-speed scientific computing.
Thinking Machines’ CM (Connection Machine) — early massively parallel
supercomputer.
Modern example:
GPUs (Graphics Processing Units) also follow the SIMD idea — thousands of cores
execute the same instructions on different pixels or data.
Page 8
How does it work?
A single instruction is broadcast to all processors (Processing Elements(PEs)).
The input data is divided into multiple chunks — each processor handles a different chunk
in parallel.
Example: Cᵢ = Aᵢ × Bᵢ
Vectors A and B are split across processors; each PE computes its own Cᵢ.
3. MISD Systems:
MISD means different instructions operating on the same data in parallel — but it’s not
practical for most real-world applications, so it’s mostly studied as a theoretical model.
MISD stands for Multiple-Instruction, Single-Data:
It’s a multiprocessor system where multiple processors each execute different
instructions on the same data stream.
So:
Multiple instruction streams
Single shared data input
Page 9
One single data input stream feeds all processors.
Each processor has its own unique instruction stream, performing different operations on the
same data.
The results are combined into a single data output stream.
Example:
Input data x
Processor 1: sin(x)
Processor 2: cos(x)
Processor 3: tan(x)
Final output: y = sin(x) + cos(x) + tan(x)
MISD architectures are more of an intellectual concept than a practical one.
They have very limited practical use.
A few experimental systems have been built, but none are commercially available.
4. MIMD Systems:
MIMD systems execute multiple instructions on multiple data sets, with independent
processors working asynchronously — making them the most powerful and flexible
architecture for modern parallel and distributed computing.
MIMD stands for Multiple-Instruction, Multiple-Data:
It’s a multiprocessor system where each processor executes its own instruction
stream on its own data set.
All processors operate independently and asynchronously.
How does it work?
Multiple Instruction Streams:
Each processor fetches and executes its own unique instructions.
Multiple Data Streams:
Page 10
Each processor works on its own separate chunk of data.
Independent Processing Elements (PEs):
No global lock-step coordination; each PE works at its own pace.
Page 11
Why Parallel Programming?
• To make efficient use of multiple processing elements (PEs).
• To reduce execution time and handle large computational tasks.
Major Approaches to Parallel Programming
1. Data Parallelism
• Same operation is performed simultaneously on different chunks of data.
• Uses divide-and-conquer; splits data into sets that run on different PEs.
• Suitable for: SIMD (Single Instruction, Multiple Data) architectures.
• Example: Image processing, where each pixel or block is processed in parallel.
2. Process Parallelism
• Different operations (or tasks) run at the same time on different processors.
• Multiple distinct activities are executed in parallel.
• Suitable for MIMD (Multiple Instruction, Multiple Data) architectures.
• Example: A web server handling multiple client requests simultaneously.
3. Farmer-and-Worker Model (Master-Slave)
• A central master processor (farmer) distributes tasks to multiple worker processors
(slaves).
• Master assigns jobs → Workers process them → Workers return results to master.
• Suitable for Task distribution when work units are independent.
• Example: Rendering frames in animation or solving independent parts of a
simulation.
Levels of parallelism:
Page 12
Laws of caution:
When designing parallel systems, it’s easy to assume that adding more processors will
always linearly increase speed or performance — but real-world results show otherwise due
to factors like communication overhead, synchronization delays, and non-parallelizable
parts of the task.
The speed of computation is roughly proportional to the square root of the system cost —
not linear!
Doubling the cost does not double the speed.
Faster systems become increasingly expensive for smaller performance gains.
speed (GHz) increases gradually as you spend more money, but the rate of improvement
slows down.
The speedup gained from parallelism increases roughly logarithmically with the number of
processors.
Formula: Speed=k⋅log(N)
Where N = number of processors
Adding processors yields diminishing returns.
Beyond a point, more processors give very small speed increases due to communication and
coordination overhead.
Speed curve flattens out as the number of processors grows.
Page 13
Elements of Distributed Computing
This emphasizes resource aggregation and unified behavior across independent systems.
This figure shows a layered architecture of a traditional distributed system, composed of the
following layers:
Page 14
1. Hardware Layer
o Networking and parallel hardware (servers, network cards, etc.)
o Physical infrastructure across multiple computers.
2. Operating System Layer
o Provides core services: process management, file systems, IPC (Interprocess
Communication).
o Relies on standardized protocols (TCP/IP, UDP).
3. Middleware Layer
o Offers abstraction over the OS and hardware.
o Handles:
Communication protocols
Data formats
Distributed frameworks (e.g., CORBA, RMI, gRPC)
4. Application Layer
o End-user applications (data sharing, streaming, databases).
o Uses middleware for distributed capabilities.
Key Features
o Heterogeneity handling
o Message-passing for communication
o Appears as a single system to users
The above figure refines the distributed system into the cloud service model stack (IaaS, PaaS,
SaaS):
1. Infrastructure-as-a-Service (IaaS)
o Base layer: virtual hardware, networking, storage.
o Examples: Amazon EC2, Google Compute Engine.
o Managed by cloud providers; users have control over OS and deployed apps.
Page 15
2. Platform-as-a-Service (PaaS)
o Middleware layer abstracted as a development platform.
o Provides: frameworks, libraries, databases, app hosting.
o Examples: Google App Engine, Heroku.
3. Software-as-a-Service (SaaS)
o Top layer with end-user applications.
o Delivered via browser or apps.
o Examples: Gmail, Office 365, Dropbox.
Distributed systems are complex, involving interactions across multiple layers — from hardware to
software. However, it is the middleware layer that plays the most critical role in enabling
distributed computing. It provides a coherent and uniform runtime environment for
applications spread across different machines.
Page 16
Two Major Classes of Architectural Styles
The first class relates to the logical organization of the software; the second class includes all those
styles that describe the physical organization of distributed software systems in terms of their major
components.
Before understanding architectural styles, it's essential to define their core building blocks:
Component
Connector
Software architectural styles define the logical organization of distributed systems (irrespective of
how they're physically deployed).
Purpose
Page 17
Benefits of Using Architectural Styles
i. Data-Centered Architectures
Interaction Styles
The way components interact with the central data can vary:
o Passive Data Access: Components read/write as needed.
o Active Data Access: Data changes trigger specific actions.
1. Database Systems
2. Blackboard Systems
Page 18
Blackboard Architectural Style
Components:
1. Knowledge Sources
o Agents that add/update information in the blackboard.
2. Blackboard
o The shared memory/data space; acts like a central whiteboard.
3. Control
o Manages when and how agents act, based on blackboard changes.
Use Cases
Unlike data-centered models that focus on shared access, data-flow models focus on how
data moves between components.
Components are linked in a flow, and data is passed along to trigger computation.
Data flow acts as the communication medium.
The system’s logic is structured as data transformations across components.
Vary based on:
o How control is managed
o Concurrency level
o Flow topology
Examples
Mainframe computing
Scientific workflows: e.g., pre-filter → analyze → post-process
Data processing jobs in cloud environments
Page 19
Pipe-and-Filter Style
Examples
Microprocessor pipeline: Instruction phases like fetch, decode, execute act as filters.
Compiler pipelines: Lex → Yacc → Semantic Analyzer → Code Generator
Streaming systems: Image/video/audio processing (e.g., live encoding, real-time filters)
Characteristics
Page 20
A virtual machine engine interprets and runs the application.
May involve:
o Maintaining internal state representations
o Simulating unavailable features
Decouples application logic from hardware constraints.
Rule-Based Style
Uses an inference engine that executes rules or logic based on a knowledge base.
Programs are expressed using rules/predicates that describe conditions or behaviors.
How It Works
Use Cases
Interpreter Style
Main Components
Use Cases
Page 21
Benefits of Virtual Machine Styles:
Portability: Applications run on any system with a compatible VM
Abstraction: Developers focus on logic, not hardware.
Modularity: Easy to design reusable, high-level software components.
Limitations:
Performance overhead: Interpreting abstract instructions is slower than native execution.
Limited access to hardware: May block use of advanced system-specific features.
Complexity: Requires design of the VM itself, plus mapping to system resources
Call & Return architectures organize systems as components that communicate via method (or
procedure) calls. The system’s activity forms a chain of calls, resembling a program control flow.
This style is foundational in software engineering and forms the basis of many programming
paradigms—especially in structured, object-oriented, and layered designs.
Key Characteristics
Execution Flow:
The program executes as a call tree starting from the main function.
Calls can be local or remote (using RPCs and derivatives).
Use Cases
Pros vs Cons
Pros Cons
Easy to understand Hard to maintain as size increases
Straightforward design Poor separation of data and behavior
Compatible with RPC systems Difficult reuse and testing in large apps
Page 22
2️. Object-Oriented Style (OOP)
Execution Flow:
Use Cases
Pros vs Cons:
Pros Cons
High modularity and encapsulation Objects must know each other’s identity
Supports reuse and maintainability Shared objects may create consistency issues
Easier to model real-world entities Complexity in managing object relationships
Execution Flow
Top-down: User calls the highest layer → each layer calls the next lower one
Bottom-up: Lower layer events trigger actions in upper layers (callbacks)
Use Cases
Pros vs Cons:
Pros Cons
Modular and organized by abstraction Hard to extend without breaking layer interfaces
Easy to swap layers (if interfaces match) Adding new features across layers is complex
Supports clean separation of concerns Performance overhead due to layer traversal
Page 23
v. Architectural Styles Based on Independent Components
Types:
Client-Server Model: One component (client) requests services from another (server).
Peer-to-Peer Model: All components can act both as clients and servers.
Suitable For:
Distributed systems
Systems spread across networked nodes
Services needing loose coupling with service discovery
Examples:
Pros vs Cons:
Advantages Disadvantages
Clear separation of components Overhead of process communication
High scalability in distributed systems Complex synchronization
Supports concurrency and modular design Harder to debug and manage race conditions
Page 24
Key Concepts:
Publish–Subscribe Model
Events carry contextual information
Invocation is implicit, not direct
Suitable For:
Examples:
Pros vs Cons:
Advantages Disadvantages
Loose coupling and extensibility Loss of control over execution flow
Cannot guarantee event handling order or
Easy integration of new modules
even presence
Dynamic runtime behaviour; handlers Hard to analyze system correctness
don’t need known identities statically
System architectural styles define how components and processes are physically organized over
a distributed infrastructure. They:
a) Client/Server
b) Peer-to-Peer
Page 25
a) Client/Server Architecture
Characteristics:
Client Types
1. Thin Client:
2. Fat Client:
1. Two-Tier Architecture:
Page 26
2. Three-Tier (or N-Tier) Architecture:
Separates:
o Client (UI/presentation)
o Application server (business logic)
o Database server (data storage)
Scalable: Tiers can run on separate machines
Flexible and maintainable
Complex to deploy and manage
Example of 3-tier:
Tier Component
Presentation Web browser (client)
Application Logic Web server or app server
Data Storage Database server (e.g., MySQL)
Advantages of Client/Server:
Limitations:
Page 27
Each peer:
o Sends requests (like a client)
o Processes incoming requests (like a server)
Client/Server vs Peer-to-Peer:
Feature Client/Server Peer-to-Peer
Architecture Centralized Decentralized
Roles Distinct client and server Each peer acts as both client and server
Scalability Limited by server capacity High scalability with more peers
Fault Tolerance Single point of failure (server) More resilient (no central failure point)
Management Easier (central control) Harder (distributed algorithms required)
Examples Web apps, email, databases BitTorrent, Gnutella, Skype
Page 28
Common IPC Models:
1. Shared Memory
Example Use:
Characteristics:
Request/response model
Provides language-level abstraction (stub functions)
Common in service-oriented architectures (SOA)
Examples:
3. Message Passing
Characteristics:
Examples:
4. Sockets
Page 29
Socket Types:
Typical Pattern:
Message-Based Communication:
A message refers to any discrete unit of information exchanged between distributed components.
It includes:
In essence, any IPC model that doesn’t rely on streaming data and instead transmits data in
bounded chunks can be called message-based.
Why Messages?
— Couloris et al.
Message-Based Communication
1. Message Passing
Page 30
Implies a client/server model.
Examples:
o gRPC, Java RMI, XML-RPC, Apache Thrift
3. Distributed Objects
Each object or agent has its own thread of control (active entity).
Messages may represent commands, events, or triggers for behavior.
Semantics of messages is richer than in RPC (may trigger asynchronous workflows).
Examples:
o JADE (Java Agent DEvelopment Framework)
o Akka actors (in Scala/Java)
o Erlang processes
5. Web Services
Subtypes:
1. Direct Communication
o Message sent synchronously or asynchronously.
o Receiver immediately processes the message.
2. Queue-Based Communication
o Message is placed in a queue.
o Receiver processes messages later (decoupled).
o Enables asynchronous and reliable delivery.
Best for:
Example Technologies:
Sockets
JMS (Java Message Service) in P2P mode
RabbitMQ queues
Workflow:
Dispatch Strategies:
Page 32
Best for:
Event-driven architectures
Notifications systems
Real-time analytics and monitoring
Example Technologies:
MQTT
Apache Kafka
Amazon SNS
Redis Pub/Sub
Characteristics:
Best for:
Example Technologies:
gRPC
HTTP REST APIs
ZeroMQ request-reply pattern
AMQP RPC
Comparison Table
Interaction Addressing
Model Suitable Use Case Decoupling Examples
Pattern Style
Explicit JMS,
Point-to- One-to-one, Direct messaging,
(known Low RabbitMQ,
Point Many-to-one task delegation
address) TCP sockets
Kafka,
Publish- Event
One-to- Implicit (by MQTT,
and- notifications, real- High
many topic) Redis
Subscribe time updates
Pub/Sub
Service queries, HTTP,
Request- One-to-one Explicit or
APIs, Medium gRPC,
Reply (2-way) topic-based
command/response ZeroMQ
Page 33
Technologies for distributed computing
Remote Procedure Call (RPC) is a foundational abstraction that extends the concept of a local
procedure call across process and memory boundaries, enabling a client to execute a procedure on a
remote system as if it were local. Developed in the early 1980s, RPC remains a critical component
for Inter-Process Communication (IPC) in modern complex systems due to its robust and well-
established nature.
1. Server Procedure Design: Develop and implement the procedures that will be made
available for remote invocation on the server side.
2. Procedure Registration: Register these remote procedures with the RPC server on the node
where they will be hosted and made accessible.
3. Client Code Implementation: Design and implement the client-side code responsible for
invoking these remote procedures.
RPC implementations typically offer client and server Application Programming Interfaces (APIs)
to simplify the use of this powerful abstraction. A critical consideration for parameter and return
value passing in RPC is the distributed nature of the client and server processes:
RPC has long been a dominant IPC technology, with widespread support across various
programming languages and environments through libraries and packages (e.g., RPyC for Python).
Furthermore, platform-independent solutions like XML-RPC and JSON-RPC facilitate RPC over
XML and JSON, respectively. Frameworks like Thrift (developed by Facebook) aim to provide
transparent cross-language RPC.
It's important to note that the term "RPC implementations" now broadly encompasses a range of
solutions that have evolved from the original RPC concept. These include distributed object
programming frameworks (such as CORBA, DCOM, Java RMI, and .NET Remoting) and Web
services, each with their own unique characteristics that will be discussed in subsequent sections.
Instead of procedures, distributed object frameworks manage instances exposed via well-defined
interfaces. The typical interaction flow is:
1. Server Registry: The server process maintains a registry of active objects, making them
available to other processes, often published through interface or class definitions.
2. Client Reference Acquisition: The client obtains a reference to a remote object using a
specific addressing scheme. This reference is a pointer to a local instance conforming to the
shared interface/class definition.
3. Remote Method Invocation: The client invokes methods on this "local" reference, and
parameters/return values are marshaled, similar to RPC.
Page 35
Proxy-Skeleton Mechanism for Transparency
Proxy (Client-side): The client environment interacts with an "Object Proxy." This proxy,
generated as a subclass of the server-published type, translates local method calls into RPC
calls for the remote object.
Skeleton (Server-side): The server maintains an "Object Skeleton" component. When an
RPC request is received, the skeleton unpacks it, dispatches the method call to the actual
remote object instance, and after execution, packs and sends return values back to the client.
Inheritance for Transparency: The transparency of remote method invocation is enabled
by object-oriented inheritance/subclassing, where both the proxy and the remote object
expose the same interface.
Distributed object frameworks treat objects as first-class entities for IPC, allowing them not only to
be invoked remotely but also to be passed as parameters and return values. This introduces a
significant design consideration:
Page 36
Object activation and lifetime
Managing distributed objects presents challenges beyond simple remote procedure calls, primarily
due to object instances maintaining internal states that can be altered by method execution. A
critical aspect of distributed object-oriented systems is the lifetime of an object instance, which
differs significantly from a single memory address space. In a local context, object creation,
reference management, and memory reclamation (manual or automatic) are straightforward.
However, a distributed environment introduces complexities requiring distinct lifetime management
strategies for remotely exposed objects.
Object activation and lifetime management features are now standard in most distributed object
programming frameworks. They are fundamental for:
Page 37
Common Object Request Broker Architecture (CORBA)
Object Request Broker (ORB): Acts as a central "object bus." CORBA objects register
their interfaces with the ORB, allowing clients to obtain references and invoke methods. The
ORB manages low-level remote invocation operations.
Interface Definition Language (IDL): Provides platform-independent interface
specifications. IDL compilers generate language-specific client (stub) and server (skeleton)
code, which developers then implement.
Internet Inter-ORB Protocol (IIOP): Standardizes communication between different ORB
implementations, ensuring low-level interoperability.
Portable Object Adapter (POA): Separates the ORB's networking concerns from the
runtime environment that hosts and manages skeletons, offering architectural flexibility.
DCOM, a Microsoft solution predating .NET, extended COM components beyond process
boundaries into distributed environments. While architecturally similar to CORBA, it's simpler and
primarily focused on Microsoft ecosystems, lacking CORBA's broad interoperability goals.
COM Objects: Encapsulate coherent operations and standardize a binary format for
language interoperability.
Distributed Capabilities: DCOM adds IPC support to enable distributed use of COM
objects.
Interface Pointers: Clients obtain pointers to exposed interfaces and interact as if with a
local object, with the DCOM runtime managing the illusion.
Microsoft-Centric: Its implementation is largely monopolized by Microsoft, offering
reasonable interoperability within Microsoft-based environments. Though still present, it's
largely superseded by newer technologies like .NET Remoting.
Java RMI is Java's native technology for RPC among distributed Java objects, enabling method
invocation on objects residing in different Java Virtual Machines (JVMs).
Page 38
.NET Remoting
.NET Remoting is the IPC technology for .NET applications, offering a unified platform for
accessing remote objects across any .NET-supported language. It distinguishes itself with its high
customizability.
Customizable Architecture: Developers have control over transport protocols (e.g., TCP,
HTTP), serialization formats, object lifetime management, and server-side object
management.
Application Domains: Represents isolated execution environments within a process.
Remoting enables transparent interaction between objects in different application domains,
whether on the same process, machine, or different nodes.
MarshalByRefObject: Classes intended for remote access must inherit from
MarshalByRefObject. Objects not inheriting from this are copied (marshaled by value)
across application domain boundaries.
Automatic Proxy Generation: No manual stub generation is required; the Remoting
infrastructure automatically provides information to generate client proxies.
Registration: Components are made accessible by registering them with the Remoting
runtime and mapping them to URIs (e.g., scheme://host:port/ServiceName).
Activation Strategies: Supports providing an instance or just type information (leading to
automatic, client-based activation). Developers can override default lifetime behaviors.
Transparent Interaction & Security: Offers transparent interaction with remote objects
and allows customization of security measures, similar to Java RMI.
What is a Service?
Page 39
operate in unpredictable environments with third-party interactions. SOC addresses potential
issues like unnoticed failures, malformed messages, or unauthorized clients through
mechanisms like transactions, durable queues, redundant deployment, failover, and managed
trust relationships.
Shared Schema and Contracts (not Class/Interface Definitions): Services define
themselves through schemas and contracts, rather than classes or interfaces common in
object-oriented systems. A service advertises a contract detailing the structure and ordering
of messages it can send or receive. This approach enhances consumability in diverse and
heterogeneous environments. To manage evolution, contracts and schemas are designed for
stability, allowing services to change without breaking existing client code. Technologies
like XML and SOAP are instrumental in supporting this feature.
Policy-Based Compatibility: Service orientation distinguishes between structural and
semantic compatibility.
o Structural Compatibility: Based on contracts and schemas, it can be validated and
enforced by automated means.
o Semantic Compatibility: Expressed through "policies" that define a service's
capabilities and requirements. These policies are essentially expressions that must
hold true for the service to operate normally, ensuring alignment beyond just
message structure.
Service-Oriented Architecture (SOA) is an architectural style that organizes a software system into
a collection of interacting services. It provides a set of design principles for building coherent,
decentralized systems by packaging functionalities into interoperable services that can be integrated
across different business domains.
Service Provider: Maintains and offers one or more services for consumption. Providers
can publish their services in a registry along with a service contract, which details the
service's nature, usage instructions, requirements, and any associated fees.
Service Consumer: Locates service metadata in the registry and develops client
components to bind to and utilize the service.
It's common for components in SOA systems to act as both providers and consumers, orchestrating
or choreographing services to fulfill requests.
SOA emphasizes interoperability, standards, and service contracts, characterized by the following
principles:
Page 40
Loose Coupling: Services are self-contained, minimizing dependencies on other services.
They only need to be aware of each other's contracts, enabling flexible aggregation and agile
design.
Abstraction: Service contracts and description documents fully define a service, hiding its
internal logic and implementation details. This simplifies system definition from a business
perspective.
Reusability: Services are designed as reusable components, reducing development time and
costs, promoting agile design, and allowing for leveraging third-party services.
Autonomy: Services control their encapsulated logic, and consumers do not need
implementation knowledge.
Lack of State: Services are ideally stateless (at least in principle), increasing their
reusability and aggregatability, especially when consumed by multiple clients across
different domains.
Discoverability: Services are defined by metadata-rich description documents, facilitating
their effective discovery and utilization of third-party resources.
Composability: Services act as building blocks, enabling the implementation of complex
operations through orchestration and choreography to achieve business goals.
While early SOA implementations leveraged distributed object technologies like CORBA (due to
its interoperability focus), Web services are currently the predominant technology for realizing
SOA due to their interoperable platform for system and application connectivity. Beyond principles,
frameworks like the Service-Oriented Modeling Framework (SOMF) and reference architectures
from OASIS guide effective SOA implementation.
Web Services
Web services are the leading technology for implementing Service-Oriented Architecture (SOA)
systems and applications, leveraging Internet technologies and standards to build distributed
systems. Their popularity in SOA stems from several key advantages:
Interoperability: They support cross-platform and cross-language communication.
Standardization: Based on widely adopted, vendor-independent standards like HTTP, SOAP,
XML, and WSDL.
Ease of Integration: Provide a simple and intuitive way to connect disparate software systems,
facilitating rapid service composition.
Enterprise Features: Offer essential functionalities for industrial use, including service discovery
and metering (for contract compliance).
Core Concept and Interaction
At its core, a Web service exposes a set of operations that can be invoked using Internet-based
protocols, primarily HTTP. These operations support complex and simple parameters and return
values, whose semantics are defined using XML and WSDL in a platform-independent manner.
Web services are hosted on Web servers, making HTTP the most common transport protocol.
Page 41
1. Deployment & Description: System architects develop a Web service and deploy it on a
compatible Web/application server. A Web Service Definition Language (WSDL)
document, which describes the service's interface and operations, is either uploaded to a
UDDI Registry (a global catalog) or directly attached as metadata to the service.
2. Discovery: Service consumers can discover services by querying a UDDI registry or, more
commonly, by directly requesting the WSDL metadata from the Web service itself.
3. Client Generation: The WSDL document enables service consumers to automatically
generate client-side proxies for the service, which are then integrated into their existing
applications.
4. Invocation: The "WS Client" (Web Service Client) application then uses this generated
client to send an "Invocation" request over the network to the Web service, and receives a
"Response" back.
Web services are seamlessly integrated into mainstream programming languages through extensive
library and tool support, requiring less integration effort compared to older technologies like
CORBA. Their inherent interoperability makes them a superior solution for SOA compared to
platform-specific distributed object frameworks such as .NET Remoting, Java RMI, and
DCOM/COM+, which limit applicability to single environments.
Beyond simple remote method invocation, Web services encompass a stack of technologies that
facilitate the integration of heterogeneous applications and enable service-oriented computing (as
shown in Figure 2.17, which is not provided but described). The backbone of all these
technologies is XML, which significantly contributes to their popularity and ease of use. XML-
based languages are used for:
In practice, SOAP and WSDL are the core enabling components of Web services.
Page 42
Simple Object Access Protocol (SOAP):
The primary functions of SOAP (Simple Object Access Protocol) messages are method
invocation and result retrieval for Web services. As illustrated in Figure 2.18, SOAP messages
are XML documents structured with an Envelope, an optional Header (for metadata like routing or
security), and a Body (containing the method call or execution result). For example, Figure 2.18
shows a SOAP message invoking a GetStockPrice method and its corresponding response message.
While XML's platform independence makes SOAP versatile, its verbose markup can lead to
inefficiency.
Page 43
Addressing SOAP's Inefficiency: Representational State Transfer (REST)
Web Service Description Language (WSDL) is an XML-based language crucial for describing
Web services. It defines the service's interface, specifying the methods that can be called, along
with the types and structures of their required parameters and return values.
Type and Structure Information: As Figure 2.18 highlights, SOAP messages themselves
don't contain type information for parameters or return values; this crucial metadata is stored
within the associated WSDL document.
Automatic Client Generation: WSDL's XML-based nature allows for the automatic
generation of Web service clients in any programming language capable of interpreting
XML. This feature is fundamental to Web service interoperability and makes them a
preferred choice for SOA over less natively interoperable distributed object frameworks like
.NET Remoting, Java RMI, and DCOM/COM+.
Beyond core Web service technologies, Web 2.0 advancements further enhance Web and SOA-
based applications:
Page 44