SOA Notes - v2.0
SOA Notes - v2.0
25
Version 2.0
Updated
20
E,
04 Mar 2025
SC
M
SOA Syllabus 6
Unit 1: Introduction to Service-Oriented Architecture 6
Unit 2: SOA Design and Modeling 6
Unit 3: SOA Implementation Technologies 6
Unit 4: Security and Governance in SOA 7
Unit 5: SOA Emerging Trends 7
SOA Lab Exercises 8
Exercise 1: Overview of Service-Oriented Architecture 8
Steps / Tasks 8
Exercise 2: Principles and Concepts of SOA 9
Steps / Tasks 9
Exercise 3: Contemporary Trends in SOA 10
Steps / Tasks 10
25
Exercise 4: Artificial Intelligence (AI) and Machine Learning (ML) in SOA: 11
Steps / Tasks 11
20
Reference Books 13
Terminology 14
E,
Unit-1 Introduction to Service Oriented Architecture 15
SC
Motivations of SOA 15
What is SOA 18
M
SOA Components 21
Evolution and Historical Context of SOA 22
SE
25
Graph QL 47
Examples and Code Snippets 47
20
Microservices Architecture and its Relationship with SOA
E, 48
Decentralized Data Management: 48
Independent Deployment: 49
SC
Infrastructure Automation 50
Relationship with SOA 51
M
Containerization 52
SE
Docker Container 52
Kubernetes Orchestration 54
fI
Event-Driven Architecture 56
Event Sourcing 56
t
ep
25
Example Use Case 75
Predictive Analytics 75
20
Key Techniques E, 75
Example Use Case 75
Natural Language Processing (NLP) 76
SC
Key Applications 76
Example Use Case 76
M
Key Components 78
Types of Edge Gateway Architectures 79
fI
Example Architecture 80
1. Smart City Traffic Management 80
t
ep
25
20
E,
SC
M
,B
SE
fI
t .o
ep
D
25
1.5 Contemporary Trends in SOA
20
- Microservices Architecture, Cloud Computing and SOA
- Serverless Computing and SOA, AI/ML in the Service Ecosystem
E,
Unit 2: SOA Design and Modeling
SC
25
4.2 Data Encryption and Integrity
20
- Message-Level Encryption (XML Encryption), Digital Signatures (XML Signature),
- JSON & gRPC, Data at Rest for AI Models E,
- Secure Hash Algorithms (SHA), Securing APIs and Web Services,
SC
Objective:
Introduce students to SOA basics by creating a simple, containerized web service that
clients can consume.
Steps / Tasks
25
2. Containerization
20
○ Create a Dockerfile for your service. E,
○ Use Docker to containerize and run your service locally (e.g., docker
SC
service.
○ Demonstrate basic operations (GET, POST, PUT, DELETE).
fI
.o
Objective:
Implement a loosely coupled service architecture using asynchronous messaging.
Steps / Tasks
25
○ Implement a separate service that subscribes to the broker and processes
20
messages independently (e.g., logs them, stores them in a DB, triggers a
workflow).
E,
SC
4. Observability
,B
metrics).
.o
Objective:
Explore Serverless Computing and integrate it into an existing SOA/microservice
ecosystem.
Steps / Tasks
25
Functions’ HTTPS endpoint to make your function externally callable.
20
○ Verify your function can accept inputs and return outputs.
3. Integration with Other Services
E,
SC
○ Demonstrate that the function can be part of a broader SOA. For example,
,B
○ Show how to monitor invocation counts, latency and cost metrics for your
t
serverless function.
ep
limits, etc.).
Objective:
Build and integrate a simple AI-driven service (e.g., classification, sentiment analysis,
or basic prediction) within an SOA-based architecture.
Steps / Tasks
25
classification dataset like MNIST).
2. Build a Service for ML Inference
20
○ Wrap the model in a REST endpoint (Flask, FastAPI, or any framework).
E,
○ Accept input data (text, image, numeric features) and return inference
SC
results.
M
3. Containerize
,B
For instance, the client sends text or image data and the AI service returns
t
ep
a prediction.
D
25
20
E,
SC
M
,B
SE
fI
t .o
ep
D
25
20
E,
SC
M
,B
SE
fI
t .o
ep
D
25
an enterprise
20
E,
SC
M
,B
SE
fI
t .o
ep
D
Motivations of SOA
25
- Cab Booking applications (Ola, Uber, Rapido, Namma Yatri, etc)
20
- e-Commerce (Amazon, Flipkart) E,
- Quick Commerce (Zepto, Blinkit)
SC
25
20
E,
SC
M
,B
SE
transactions)
t
ep
25
20
E,
Source:https://paytm.com/blog/investor-relations/how-paytm-achieved-operational-profit
SC
ability/
M
,B
What is SOA
SE
fI
https://www.opengroup.org/soa/source-book/soa/index.htm
ep
2. Read Martin Fowler (ThoughtWorks) take on SOA for an article in 2005
D
https://martinfowler.com/bliki/ServiceOrientedAmbiguity.html
Formal Definition
25
systems.
20
○ It’s an approach to build software systems based on loosely coupled
E,
service components
SC
● A service:
● Is a logical representation of a repeatable business activity that has a
M
,B
● Is self-contained
fI
25
Service-Oriented Architecture (SOA) is defined by several key characteristics that
20
shape its design and implementation. These characteristics include:
E,
1. Loosely Coupled: SOA promotes loose coupling between software components,
SC
flexibility and agility in system design, as services can be modified or replaced without
,B
technologies. By adhering to open standards and protocols, such as XML, SOAP and
.o
programming languages.
D
3. Flexible: SOA is inherently flexible, allowing for the composition and recomposition
of services to meet changing business requirements. Services can be combined and
orchestrated in various ways to create new functionalities, enabling organizations to
adapt to evolving needs.
SOA Components
25
The basic unit of Service Oriented Architecture is a Service
20
● It’s a self-contained software system E,
● Accessible via APIs
SC
M
,B
SE
fI
t .o
ep
D
20
Late 1990s - Early 2000s: Emergence of Web Services
E,
● Key Events:
SC
● Technologies:
SE
● Key Events:
● Transition towards modular, loosely coupled architectures
t
ep
● Technologies:
● Adoption of SOA principles in enterprise integration
Standardization Efforts and Industry Consortia
● Key Events:
● Development of SOA-related standards and specifications
● Role of organizations like W3C and OASIS
● Technologies:
● Definition of XML, SOAP, WSDL and WS-* standards
Dept of ISE, BMSCE, 2025 22
Challenges and Criticisms in SOA Adoption
● Key Challenges:
● Complexity in service design and governance
● Cultural resistance to change
● Concerns about ROI
● Critiques:
● Effectiveness of SOA in delivering promised benefits
Legacy and Impact
● Key Influences:
● Evolution towards microservices and cloud-native architectures
● Serverless and API-first approaches also align with SOA’s idea of
exposing discrete functionality.
● Continued relevance in modern software design practices
● The concept of service boundaries remains crucial, especially in
modern AI/ML model-serving scenarios.
● Continued Relevance:
25
● Even as technology stacks shift (REST, GraphQL, gRPC), SOA’s core
vision of interoperable services still underpins enterprise
20
integration and distributed architectures.
E,
SC
Early web services emerged in the late 1990s and early 2000s as a means of enabling
SE
25
20
E,
SC
M
,B
SE
fI
t .o
ep
D
● Use Case Scenario: In the mid-90s, Amazon.com began its journey as an online
bookstore, but it quickly evolved into a platform selling a wide range of products.
To handle the complex nature of its e-commerce operations, Amazon likely
employed service-oriented principles, even before SOA was formally recognized.
25
20
E,
SC
M
,B
SE
fI
t .o
ep
D
● Use Case Scenario: Expedia, founded in the late 1990s, revolutionized the travel
industry by offering an online platform for booking flights, hotels, rental cars and
vacation packages. To provide a seamless booking experience to its users,
Expedia likely employed SOA principles in its system architecture.
● Use Case Scenario: SAP, a leading provider of ERP software, has been in the
industry since the early 1970s. While its early systems may not have fully
embraced SOA principles, SAP likely transitioned towards a more
service-oriented approach in the late 1990s and early 2000s to address the
growing complexity of enterprise operations.
25
● SOA Characteristics: SAP's ERP system would consist of various modules or
20
services responsible for different business functions, such as finance, human
E,
resources, supply chain management and customer relationship management.
SC
specific needs.
SE
25
XML (eXtensible Markup Became the go-to format Shift to JSON: Over time,
Language): A markup for structuring data in many services adopted
20
language used for SOAP messages and JSON due to its lighter
E,
encoding documents in a configuration. weight and better fit for
SC
machine-readable
SE
fI
25
(MaaS). This trend significantly extends the original SOA concepts by emphasizing:
20
1. Data-Centric Interfaces E,
○ Traditional SOA focuses on functional operations (e.g., “create order,”
SC
“update account”).
○ AI-driven endpoints often revolve around model inference: accepting
M
recommendations).
SE
Buffers, etc.).
t
25
5. Impact on Traditional SOA Concepts
20
○ Contracts and Interfaces: AI endpoints tend to have input/output
E,
schemas for inference, but can evolve over time (e.g., new features or
SC
Benefits of SOA
● Business Agility:
● SOA enables organizations to respond quickly to changing market
conditions and business requirements.
● Real Use Case Netflix: Netflix employs SOA to continuously innovate its
streaming platform. With SOA, Netflix can rapidly introduce new features,
25
personalize recommendations and scale its infrastructure to accommodate
20
fluctuations in viewer demand. For example, Netflix's recommendation
service analyzes user preferences in real-time, leveraging microservices
E,
to deliver personalized content recommendations instantly.
SC
● Interoperability:
M
Challenges in Implementation
25
struggle with governing access to sensitive data across multiple
20
departments and agencies. Implementing robust governance frameworks
E,
and security policies is essential to address these challenges and ensure
SC
25
● Key Characteristics:
20
● Service Decomposition: Applications are decomposed into smaller,
independently deployable services, each responsible for a specific
E,
business capability.
SC
● Key Characteristics:
● On-Demand Self-Service: Users can provision and manage computing
resources, such as servers and storage, without human intervention.
● Resource Pooling: Cloud providers pool and dynamically allocate
resources to multiple users, optimizing resource utilization and scalability.
● Pay-Per-Use Billing: Users pay only for the resources they consume,
enabling cost-effective and scalable solutions.
● Scalability and Elasticity: Cloud services can scale up or down based on
25
demand, ensuring performance and availability.
20
● Real Use Case: Airbnb
● Airbnb leverages cloud computing services, such as Amazon Web
E,
Services (AWS), to power its online marketplace for lodging and tourism
SC
experiences.
M
Serverless computing is a cloud computing model where cloud providers manage the
infrastructure, dynamically allocating resources as needed and users only pay for the
compute resources consumed by their applications.
● Key Characteristics:
25
● By adopting a serverless architecture on AWS Lambda, Lyft can
20
dynamically scale its backend services in response to user demand,
E,
ensuring low-latency responses and optimal performance.
SC
infrastructure.
,B
SE
fI
t .o
ep
D
Service Coupling
Definition: Service Coupling refers to the degree of interdependence between any two
business processes or services within a system.
25
20
Preferable State: In SOA, weak coupling is preferred, indicating lower dependency
for increased flexibility, scalability and maintainability.
E,
SC
● Explanation:
● Weak coupling allows services to evolve independently, reducing the risk
M
● Example:
t
ep
service on others.
● Example: Consider an e-commerce platform where a "Checkout Service"
encapsulates functionalities such as processing payment, updating
inventory and sending order confirmation emails. This service
demonstrates strong cohesion by focusing on a cohesive set of operations
related to completing the checkout process.
Definition: Service Cohesion refers to the degree of functional relatedness and focus of
operations within a service.
Preferable State: Strong cohesion is preferred in SOA, indicating that a service should
encapsulate closely related and well-defined functionalities.
● Explanation:
○ Strong cohesion ensures that a service encapsulates a well-defined and
closely related set of functionalities, enhancing clarity, maintainability and
usability.
○ Cohesive services promote reusability and contribute to a modular and
extensible architecture.
25
● Example:
20
○ A service responsible for order processing should encapsulate
functionalities such as order validation, payment processing and inventory
E,
management, exhibiting strong cohesion.
SC
M
coupling and cohesion. For example, in systems based on WS-, interfaces often
t
ep
exhibit higher degrees of coupling due to their ad hoc and variable nature. Each
D
service endpoint may have its own unique interface, leading to increased
complexity and tighter coupling between services. Conversely, RESTful systems
adhere to uniform interfaces, promoting loose coupling and greater cohesion. For
instance, consider a banking application where WS- services handle transactions
with varying interfaces for different account types. In contrast, a RESTful
approach may use a uniform interface for all account-related operations, such as
Service Granularity
Service design principles such as cohesion, granularity and design for change are
fundamental to creating effective and maintainable service-oriented architectures. By
adhering to these principles, organizations can develop robust and adaptable systems
capable of meeting the dynamic needs of the business environment.
25
20
Preferable State: Coarse granularity is recommended in SOA, suggesting that services
should provide broad functionalities to address specific needs, promoting reusability.
E,
SC
simplicity.
SE
architecture.
.o
25
Service Contract Design and Management
20
This section explores critical aspects of designing and managing service contracts in a
E,
Service-Oriented Architecture (SOA).
SC
M
A service contract serves as the interface between service providers and consumers,
,B
defining the obligations, responsibilities and expectations of both parties. This enables
SE
as Swagger) allows developers to define clear and standardized interfaces for various
D
25
changes or updates to the API contract are communicated and agreed upon before
20
implementation, reducing the risk of compatibility issues.
E,
SC
time.
SE
● Best practices for versioning service contracts to ensure seamless migration and
t
Example: A cloud storage provider (e.g. AWS S3, DropBox) introduces a new version of
its API to support additional features and improve performance. To ensure backward
compatibility, the provider maintains support for the previous API version while allowing
clients to migrate to the new version at their own pace. Through versioning and
effective communication of changes, the provider minimizes disruptions for existing
clients and facilitates the adoption of new features by offering clear migration paths.
Interface Definition Languages (IDLs) are formal languages used to describe the
interfaces of software components, enabling communication and interaction between
distributed systems. This lecture explores the role of IDLs in service-oriented
architectures (SOAs), their key features and their application in modern software
development.
Definition of IDLs
25
or running on different platforms.
Features of IDLs
20
E,
SC
interface.
SE
seamlessly.
t
architectures to interact.
Types of IDLs
25
20
Protocol Buffers (protobuf) E,
SC
M
,B
SE
fI
t .o
ep
D
Apache Thrift
25
20
E,
SC
M
,B
SE
fI
t .o
ep
25
availability and service health.
20
● Fault Tolerance in Serverless Computing: E,
● Example: In a serverless architecture for a real-time analytics platform,
SC
and stress-testing tools, like Chaos Monkey. They help to discover issues
.o
25
Fault Tolerance
20
E,
● Definition: Fault Tolerance refers to the ability of a system to continue operating
SC
● Reference: https://opensource.com/article/19/3/tools-fault-tolerant-system
D
● Definition: The Circuit Breaker Pattern is a design pattern used to handle faults
and failures in distributed systems by temporarily suspending requests to a failing
service.
● b: In SOA, circuit breakers monitor the health of downstream services and prevent
cascading failures by quickly detecting and isolating faulty components.
Dept of ISE, BMSCE, 2025 44
● Example: In a microservices architecture for a social media platform, a circuit
breaker is implemented in the Notification Service to prevent excessive retries
when sending notifications to users. If the Notification Service experiences a high
error rate, the circuit breaker opens, temporarily halting requests to the service
and preventing overload.
25
20
E,
SC
M
,B
SE
fI
t .o
ep
D
25
● SOAP messages are typically transported over HTTP. Other protocols like SMTP
(Simple Mail Transfer Protocol) and JMS (Java Message Service) can also be
20
used.
E,
● SOAP provides a robust messaging framework with features such as security,
SC
document.
fI
● It relies on standard HTTP methods such as GET, POST, PUT, DELETE for
performing CRUD (Create, Read, Update, Delete) operations on resources.
● RESTful APIs expose resources as URIs (Uniform Resource Identifiers) and use
HTTP status codes for indicating the outcome of operations.
● REST APIs are lightweight, easy to understand and widely adopted for building
web services, especially for public-facing APIs.
SOAP:
● Example: Integrating a payment gateway API into an e-commerce platform.
● Code Snippet: SOAP
25
<soapenv:Envelope
20
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:web="http://www.example.com/webservice">
E,
<soapenv:Header/>
SC
<soapenv:Body>
<web:ProcessPayment>
M
<web:Amount>100.00</web:Amount>
,B
<web:CardNumber>1234567890123456</web:CardNumber>
<!-- Additional Payment Details -->
SE
</web:ProcessPayment>
</soapenv:Body>
fI
</soapenv:Envelope>
t .o
REST:
ep
import requests
url = "https://api.weather.com/data"
params = {"city": "Bangalore", "format": "json"}
GraphQL:
● Example: Fetching user profile data from a social media platform API.
● Code Snippet (GraphQL query)
query {
user(id: "123@fb.com") {
id
name
email
posts {
id
title
content
}
}
}
25
20
Microservices Architecture and its Relationship with SOA
E,
SC
focused on a specific business capability and communicates with other services through
,B
well-defined APIs.
SE
fI
● In microservices architecture, each service manages its own data store, which is
t
ep
Code Snippet
class UserService:
def __init__(self, db):
self.db = db
25
20
def get_user(self, user_id):
# Code to retrieve user information from the user database
E,
pass
SC
# Example usage
user_db = UserDatabase()
M
user_service = UserService(user_db)
,B
user_service.create_user(user_data)
SE
Independent Deployment:
fI
● Each service can have its own deployment pipeline, testing strategy and release
D
Example:
In a retail application, the product catalog service can be updated with new product
information independently of the checkout service. This allows the product team to
release updates to the catalog without waiting for the checkout team, enabling faster
innovation.
Code Snippet
Dept of ISE, BMSCE, 2025 49
# Example deployment configuration for a microservice
services:
- name: product-catalog
version: v1.2.0
replicas: 3
image: product-catalog:v1.2.0
ports:
- 8080
environment:
- ENVIRONMENT=production
- DATABASE_URL=postgres://user:password@10.2.2.3:5432/catalog
Infrastructure Automation
25
● Infrastructure is often defined as code using tools like Terraform or Kubernetes,
20
allowing for consistent and repeatable deployments.
E,
● Automation enables efficient resource utilization, improves system reliability and
SC
Example:
,B
SE
Code Snippet:
D
Example
25
deployable services handling specific banking functions like account management, transactions
and customer notifications.
20
E,
Code Snippet
SC
@RestController
@RequestMapping("/transactions")
,B
@Autowired
fI
@PostMapping("/process")
t
ep
public ResponseEntity<Transaction>
processTransaction(@RequestBody TransactionRequest request) {
D
Transaction transaction =
transactionService.processTransaction(request);
return ResponseEntity.ok(transaction);
}
}
Containerization
25
20
E,
SC
M
,B
SE
Source: https://www.xenonstack.com/insights/containerization
fI
Docker Container
t .o
● Docker containers are isolated environments that share the host operating
system's kernel, providing consistency across different environments.
● Docker uses Dockerfiles to define container configurations and Docker images to
package applications and their dependencies.
20
Containerization - Pros and Cons E,
Reference: https://www.xenonstack.com/insights/containerization
SC
● Pros
M
virtual machines
t
ep
● Cons
○ Security - vulnerability of container engine and poor access control has
D
associated risks
○ Manageability - managing large number of containers is challenging
○ Monitoring - needs a good monitoring system for effective maintenance
and troubleshooting.
# Dockerfile
FROM python:3.9-slim
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
CMD ["python", "app.py"]
Kubernetes Orchestration
25
smallest deployable units in Kubernetes.
20
E,
SC
M
,B
SE
fI
t .o
ep
D
25
20
Service Mesh Technologies E,
● Service mesh technologies like Istio and Linkerd provide a dedicated
SC
containerized environment.
,B
# destination-rule.yaml
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: default-mtls
spec:
host: "*.default.svc.cluster.local"
Dept of ISE, BMSCE, 2025 55
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
Event-Driven Architecture
Event-Driven Architecture (EDA) is an architectural pattern where the production,
detection, consumption and reaction to events are central to the design. EDA enables
decoupled, scalable and responsive systems by promoting loose coupling between
components and allowing them to communicate asynchronously through events.
Event Sourcing
25
● Instead of storing the current state of an entity, Event Sourcing stores a log of
20
events that represent state transitions over time.
E,
● Event Sourcing enables reconstructing the current state of an entity at any point
SC
25
Example: Ride-sharing App
20
A ride-sharing application uses event-driven messaging to notify drivers of ride
E,
requests, update the status of ongoing rides and handle payment transactions.
SC
import json
SE
producer = KafkaProducer(bootstrap_servers='localhost:9092',
fI
value_serializer=lambda v:
json.dumps(v).encode('utf-8'))
t .o
'amount': 100.00}
D
producer.send('orders', value=event)
producer.flush()
Designing an API for a weather service that provides endpoints like /weather/{city} to
retrieve weather information for a specific city and /forecast/{city} to get a weather
25
forecast.
Developer Portals
20
E,
SC
The GitHub Developer Portal offers comprehensive documentation, tutorials and API
ep
● Rate Limiting and Quotas control the number of requests an API consumer can
make within a specific time frame to prevent abuse and ensure fair usage.
● Rate limits are typically enforced based on factors such as API keys, user
authentication, IP addresses or subscription plans.
Example: Implementing rate limiting for a social media API to restrict users to 1000
25
requests per hour to prevent spamming and ensure server stability.
20
Code Snippet: Implementing rate limiting using Flask and Redis:
E,
from flask import Flask, jsonify, request
SC
app = Flask(__name__)
SE
limiter = Limiter(
app,
fI
key_func=get_remote_address,
.o
@app.route('/api/resource')
@limiter.limit("10 per minute")
def get_resource():
return jsonify({'data': 'Resource data'})
if __name__ == '__main__':
app.run(debug=True)
25
denial-of-service (DoS) attacks and man-in-the-middle (MitM) attacks.
Identifying threat models for a banking application's SOA, including risks such as SQL
M
25
a whitelist of allowed values,Use prepared statements and parameterized queries
20
to prevent SQL injection and Use secure XML parsers that disable external entity
E,
resolution to prevent XXE attacks.
SC
Implement strict access controls on APIs to ensure only authorized users can
access sensitive data,Encrypt sensitive data at rest using strong encryption
SE
limiting to restrict the number of requests a client can make within a specified
time frame, Use load balancers to distribute traffic across multiple servers,
preventing any single server from becoming overwhelmed, Deploy IDPS to
monitor network traffic and detect potential DoS attacks.
key security risks specific to healthcare apps and methods to address them:
25
restrict access to data based on user roles and responsibilities.
20
2. Insecure Communication:
○ Risk: Data transmitted between services can be intercepted, leading to
E,
SC
○ Risk: Improper input validation can lead to injection attacks such as SQL
ep
25
disruption of normal operations.
20
○ Addressing: E,
■ Rate Limiting: Implement rate limiting to control the number of
SC
○ Risk: Lack of proper logging and monitoring can hinder the detection and
t
○ Addressing:
D
25
9. Integration with Legacy Systems:
20
○ Risk: Legacy systems may have outdated security measures, posing risks
E,
when integrated with modern SOA services.
SC
○ Addressing:
■ Secure Integration: Use secure integration methods and protocols
M
■ Security Patches: Ensure that all legacy systems are updated with
SE
○ Addressing:
D
25
confidentiality) and integrity (refers to protection against tampering) are crucial for
20
ensuring that sensitive information remains confidential and unaltered during
transmission between services. This section covers message-level encryption, digital
E,
signatures, secure hash algorithms and best practices for securing APIs and web
SC
services.
M
,B
● Definition: XML Encryption is a standard for encrypting XML data to ensure that
t
● Use Cases:
D
Example:
● Process:
1. Generate a Symmetric Key: For encrypting the data.
2. Encrypt the Data: Using the symmetric key.
3. Encrypt the Symmetric Key: With the recipient's public key for secure
transmission.
25
Digital Signatures (XML Signature)
20
E,
● Definition: XML Signature is a standard for digitally signing XML data to ensure
SC
● Verifying that the data has not been altered during transmission.
● Authenticating the sender of the XML message.
SE
fI
.o
Example:
t
<Signature>
ep
<SignedInfo>
D
<SignatureMethod Algorithm="..."/>
<Reference URI="...">
<DigestMethod Algorithm="..."/>
<DigestValue>abc123...</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>def456...</SignatureValue>
<KeyInfo>...</KeyInfo>
● Process:
1. Hash the Data: Using a secure hash algorithm.
2. Sign the Hash: With the sender's private key.
3. Attach the Signature: To the XML message.
25
vulnerabilities)
20
● SHA-256: Produces a 256-bit hash value. (Part of the SHA-2 family)
E,
● SHA-3: The latest member of the Secure Hash Algorithm family
SC
M
import hashlib
SE
hex_dig = hash_object.hexdigest()
.o
25
data has been tampered with or corrupted and appropriate
20
actions can be taken.
E,
Implementation in SOA
SC
1.Digital Signatures:
M
public key and compares the hash value with the hash of
ep
Uses in SOA:
● Ensuring data integrity by generating and comparing hash values before and
after transmission.
● Creating digital signatures by hashing data before signing it.
25
SOA API Security
20
APIs (Application Programming Interfaces) are critical components of modern software
E,
architecture, enabling communication between different services and applications.
SC
environment, is crucial to protect sensitive data and maintain the integrity of services.
,B
RESTful APIs are widely used in SOA due to their simplicity and scalability. Here are
SE
25
7. Logging and Monitoring
20
○ Log Requests and Responses: Keep detailed logs of API requests and
responses for auditing and troubleshooting.
E,
○ Ensure logs do not contain sensitive information.
SC
○ Use monitoring tools to track API usage and detect unusual patterns or
,B
Serverless Computing
Serverless computing is a cloud computing execution model where the cloud provider
dynamically manages the allocation and provisioning of servers. It abstracts the server
management from developers, allowing them to focus on writing code.
● Function-as-a-Service (FaaS)
25
● Event-driven architectures
20
E,
Function-as-a-Service
SC
Reference: https://blog.back4app.com/what-are-serverless-functions-in-cloud-computing/
Key Features
Dept of ISE, BMSCE, 2025 71
1. Event-Driven Execution:
○ Functions are triggered by events such as HTTP requests, database
changes, or message queue events.
○ Example: AWS Lambda, Google Cloud Functions, Azure Functions.
2. Automatic Scaling:
○ Functions scale automatically with the volume of incoming requests.
○ No need for manual intervention to handle varying loads.
3. Pay-per-Use:
○ Billing is based on the actual usage, such as the number of requests and
the duration of function execution.
○ Cost-effective compared to always-on server instances.
25
1. No Server Management:
20
○ Cloud provider handles server maintenance, patching and scaling.
○ Developers focus on writing code.
E,
2. Scalability:
SC
○ Pay only for actual usage (execution time and resource consumption).
t
ep
Challenges
Artificial Intelligence (AI) and Machine Learning (ML) are transforming Service-Oriented
Architectures (SOA) by enabling services to become more intelligent, adaptive and capable of
handling complex tasks. Integrating AI and ML into SOA enhances decision-making, automates
processes and improves user interactions.
Artificial Intelligence (AI) and Machine Learning (ML) are increasingly being integrated into
Service-Oriented Architecture (SOA) to significantly enhance service capabilities. This
25
integration leverages the strengths of both technologies to create more intelligent, efficient and
20
adaptive service frameworks. Here’s how AI and ML are being used within SOA:
E,
1. Service Optimization and Automation:
SC
25
allowing for preemptive maintenance and minimizing downtime.
20
By integrating AI and ML into SOA, organizations can create smarter, more responsive and
efficient service architectures that better meet the evolving needs of users and businesses. This
E,
fusion not only enhances current capabilities but also opens up new possibilities for innovation
SC
Intelligent Agents
fI
Intelligent agents are autonomous entities that observe and act upon an environment to
.o
achieve specific goals. In SOA, intelligent agents can enhance services by performing tasks
t
ep
Characteristics
1. Autonomy:
○ Operate without human intervention.
○ Make decisions based on predefined rules or learned behaviors.
2. Reactivity:
○ Respond to changes in the environment in real-time.
25
Predictive Analytics
20
Predictive analytics involves using statistical algorithms and ML techniques to analyze historical
E,
data and make predictions about future events. In SOA, predictive analytics can optimize
SC
Key Techniques
,B
SE
2. Classification:
t
ep
Natural Language Processing (NLP) is a branch of AI that focuses on the interaction between
computers and humans through natural language. In SOA, NLP can enhance services by
enabling them to understand and generate human language.
Key Applications
25
○ Extract meaningful information from text data.
20
○ Example: Analyzing customer feedback to identify common issues and
sentiments.
E,
3. Machine Translation:
SC
lecture notes on: Edge Computing and SOA Integration - Edge Gateway Architectures,
D
Edge computing refers to the practice of processing data near the edge of the network, where
the data is generated, rather than in a centralized data center or cloud. Integrating edge
computing with Service-Oriented Architectures (SOA) can enhance service performance by
reducing latency, improving reliability and enabling offline capabilities.
Dept of ISE, BMSCE, 2025 76
Edge computing plays a crucial role in the evolution of Service-Oriented Architecture (SOA) by
enhancing its capabilities and addressing some of its inherent limitations. Here are the key
points highlighting the significance of edge computing in this context:
25
of IoT networks and large-scale distributed systems.
20
3. Improved Reliability and Resilience:
○ Significance: Edge computing enhances system reliability by decentralizing
E,
processing power, reducing the impact of any single point of failure.
SC
○ Impact: SOA systems become more robust and resilient, ensuring continuous
M
○ Impact: Reduced network congestion and lower operational costs for SOA
.o
25
20
Edge Gateway Architectures
E,
An edge gateway is a device that connects edge devices (sensors, IoT devices) to the cloud or
SC
data center. It acts as an intermediary that processes data locally, making decisions, filtering
and aggregating data before sending it to the central systems.
M
,B
Key Components
SE
○ Processes data locally to reduce the amount of data sent to the cloud.
D
25
○ Architecture: Combines centralized and distributed approaches, with primary
20
gateways aggregating data from secondary gateways or edge devices.
○ Use Case: Useful in complex environments requiring multiple levels of data
E,
processing and aggregation, such as multi-site industrial facilities.
SC
○ Use Case: Effective in scenarios requiring high resilience and flexibility, such as
disaster recovery operations or military communications.
fI
○ Use Case: Suitable for applications that benefit from both local processing and
the extensive capabilities of cloud computing, like hybrid cloud environments in
retail or healthcare.
● Reduced Latency: Local data processing minimizes the time delay associated with
sending data to central servers.
Example Architecture
25
Description: In a smart city, traffic management systems use distributed edge gateways to
20
collect and process data from traffic sensors, cameras and IoT devices deployed across the city.
E,
Components:
SC
● Edge Gateways: Deployed at key intersections and traffic hubs, equipped with
processors for local data analytics.
M
● Sensors and Cameras: Collect real-time data on vehicle movement, traffic density and
,B
environmental conditions.
● Communication Interfaces: 5G and Wi-Fi for real-time data transmission between
SE
inconsistencies.
.o
● Security Modules: Encrypt data and manage access control to ensure secure
communication.
t
ep
Functionality:
D
● Real-time Traffic Analysis: Edge gateways process data locally to manage traffic
signals dynamically based on real-time conditions.
● Anomaly Detection: Immediate identification of traffic incidents or anomalies, such as
accidents or congestion.
● Data Aggregation: Periodically sends aggregated data to the central traffic
management system for long-term analysis and city-wide optimization.
Components:
Functionality:
25
● Real-time Health Monitoring: Local processing of health data for immediate alerts and
notifications to patients and caregivers.
20
● Data Aggregation: Periodically sends aggregated health data to cloud services for
comprehensive analysis and long-term health tracking.
E,
● Adaptive Treatment Plans: Enables healthcare providers to adjust treatment plans
SC
○ Sends relevant data to the cloud for further processing and storage.
D
● Cloud:
○ Provides centralized processing, analytics and long-term storage.
○ Manages and coordinates multiple edge gateways.
25
Example Use Case
20
● Autonomous Vehicles:
○ Process sensor data (e.g., LIDAR, cameras) locally to make immediate driving
E,
decisions.
SC
○ Only send summarized data to the cloud for long-term analysis and learning.
M
,B
Offline Capabilities
SE
Offline capabilities are essential for ensuring continuous operation in environments with
fI
recovery scenarios.
t
ep
25
20
E,
SC
M
,B
SE
fI
.o
t
ep
D
Prerequisites:
● Python Installation version 3.X
● Install Flask - use pip or pip3 based on your installation of python
25
● Update host firewall (if configured) to allow
20
● curl command
E,
Install Flask using pip:
SC
app = Flask(__name__)
t
ep
# Sample data
books = [
D
25
"author": data['author']
}
20
books.append(new_book)
return jsonify(new_book), 201
E,
SC
if __name__ == '__main__':
app.run(debug=True)
M
```
,B
python app.py
.o
The Flask application should be running. Invoke the service using You can consume
t
ep
Alternate command
25
● Configure Spring Boot and Tomcat
20
https://www.baeldung.com/spring-boot-configure-tomcat
● Add Spring Boot dependencies to Maven by creating pom.xml:
E,
SC
// Create pom.xml
M
<dependencies>
,B
<dependency>
<groupId>org.springframework.boot</groupId>
SE
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
fI
</dependencies>
t .o
ep
import org.springframework.boot.SpringApplication;
import
org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@GetMapping("/books")
public List<Book> getBooks() {
return books;
}
@GetMapping("/books/{id}")
public Book getBook(@PathVariable int id) {
25
Optional<Book> result = books.stream().filter(book ->
book.getId() == id).findFirst();
20
return result.orElse(null);
}
E,
SC
@PostMapping("/books")
public Book addBook(@RequestBody Book book) {
M
book.setId(books.size() + 1);
,B
books.add(book);
return book;
SE
}
fI
}
.o
class Book {
t
ep
25
20
Run the application. Spring Boot will automatically start an embedded Tomcat server
on port 8080 by default. You can now access the service using “curl” HTTP client.
E,
SC
curl http://localhost:8080/books
,B
curl http://localhost:8080/books/1
.o
Terminology
25
called “consumer” or “subscriber”.
20
● RabbitMQ is an open-source message-broker software that originally
E,
implemented the Advanced Message Queuing Protocol (AMQP).
SC
● One of the real time use cases of a message broker is for “communication
(comms)” service used in banking, ticketing and e-commerce applications to
M
post SMS or WhatsApp message to users about a transaction (e.g. credit / debit
,B
amount, order booking, shipment details, etc), In this case, a order booking
SE
service will post a message to “comms” service via message broker, this allows
fI
consumer.
t
ep
Prerequisites:
D
● Install Erlang
○ Erlang is a programming language developed by Ercisson in 1986. Erlang
is the programming language used to code WhatsApp
○ RabbitMQ is written in Erlang
○ Erlang Installation:
■ Windows Installer:
https://github.com/erlang/otp/releases/download/OTP-26.2.3/otp_wi
n64_26.2.3.exe
Dept of ISE, BMSCE, 2025 89
● Install RabbitMQ
○ https://www.rabbitmq.com/docs/install-windows#installer
● This consists of two programs in Python; a producer (sender) that sends a single
message and a consumer (receiver) that receives messages and prints them out.
It's a "Hello World" of messaging.
● https://www.rabbitmq.com/tutorials/tutorial-one-python
25
20
E,
SC
M
,B
SE
fI
t .o
ep
D
Design a simple Content Delivery Network (CDN) using Python with focus
on distributing content efficiently to users from multiple edge servers
Tech Stack:
# edge_server.py
25
20
from flask import Flask, send_file
import os E,
app = Flask(__name__)
SC
@app.route('/content/<path:path>')
M
def serve_content(path):
,B
content_dir = 'content'
file_path = os.path.join(content_dir, path)
SE
return send_file(file_path)
fI
if __name__ == '__main__':
.o
app.run(host='0.0.0.0', port=5000)
t
ep
# load_balancer.py
app = Flask(__name__)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000)
python edge_server.py
python load_balancer.py
25
20
Step 4: Accessing Content through CDN
E,
● Open a web browser and access http://localhost:8000/content/image.jpg
SC
● Refresh the page multiple times to observe content served from different edge servers.
M
Sample Results:
,B
SE
● When accessing content through the load balancer, you'll notice that the requests are
redirected to different edge servers randomly, demonstrating load balancing.
fI
● Each time you refresh the page, the image file (image.jpg) will be served from a different
.o
This basic setup demonstrates the concept of a Content Delivery Network (CDN) using Python and
Flask, focusing on load balancing and content distribution among multiple edge servers.
To build a simple AI-driven service using machine learning models and integrate it into a
Service-Oriented Architecture (SOA), you can follow these steps and use the following
tools and code snippets:
1. Objective: Develop a sentiment analysis service that analyzes customer reviews
and provides feedback on product sentiment.
2. Machine Learning Models: Use a pre-trained natural language processing (NLP)
model for sentiment analysis. For this example, we'll use the Hugging Face
Transformers library with a pre-trained BERT mode (Bidirectional Encoder
Representations from Transformers)
3. Refer: https://huggingface.co/docs/transformers/en/model_doc/bert
25
4. Tools:
● Python3 for coding
20
● Hugging Face Transformers library for NLP models
● Website: https://huggingface.co/docs/transformers/quicktour
E,
● Flask for creating the web service
SC
(sentiment_service.py)
● Code: save this code as sentiment_service.py
fI
.o
app = Flask(__name__)
nlp = pipeline("sentiment-analysis")
@app.route("/analyze_sentiment", methods=["POST"])
def analyze_sentiment():
data = request.json
text = data["text"]
result = nlp(text)[0]
return jsonify({"text": text, "sentiment": result["label"],
"confidence": result["score"]})
25
docker run -p 5000:5000 sentiment-service
20
6. Integration with SOA: E,
● Use ‘curl’ to invoke sentiments API:
SC
Output:
fI
{
.o
"sentiment": "POSITIVE",
ep
"confidence": 0.9998
D
Output:
Dept of ISE, BMSCE, 2025 94
{
"text": "This product is bad! Don’t buy it.",
"sentiment": "NEGATIVE",
"confidence": 0.9985
}
25
20
E,
SC
M
,B
SE
fI
t .o
ep
D
25
● AWS API Gateway: A service to create, publish, maintain, monitor and
20
secure APIs.
● Pillow: A Python Imaging Library (PIL) fork that adds image processing
E,
capabilities.
SC
● Requests Library: A simple HTTP library for Python to make API requests.
,B
● Prerequisites
● AWS Account: Access to an AWS account with permissions to create
SE
● Note:
.o
ns-architect/create-aws-free-tier-account/
■ !! CAUTION !!
● ONCE THIS EXERCISE IS COMPLETE, REMEMBER TO
DELETE ALL AWS RESOURCES CREATED AS PART OF
THIS EXERCISE, ELSE AWS WILL CONTINUE TO
“BILL” USAGE OF YOUR RESOURCE.
● Basic Knowledge of Python: Understanding of Python programming,
including handling JSON and HTTP requests.
25
● Install dependencies locally:
20
mkdir lambda_image_resizer
cd lambda_image_resizer
E,
virtualenv venv
SC
source venv/bin/activate
pip install Pillow
M
mkdir python
,B
cp -r venv/lib/python3.x/site-packages/*
python/
SE
import json
import base64
D
image = Image.open(BytesIO(image_data))
Dept of ISE, BMSCE, 2025 97
resized_image = image.resize((target_width,
target_height))
byte_stream = BytesIO()
resized_image.save(byte_stream, format='JPEG')
byte_stream.seek(0)
resized_image_base64 =
base64.b64encode(byte_stream.read()).decode('utf-8')
response = {
'statusCode': 200,
'body': json.dumps({'resized_image':
resized_image_base64}),
'headers': {'Content-Type':
'application/json'}
}
return response
except Exception as e:
25
return {
20
'statusCode': 500,
'body': json.dumps({'error': str(e)}),
'headers': {'Content-Type':
E,
'application/json'}
SC
}
M
4. Add the function code to the ZIP file and then In the AWS Lambda
,B
25
1. Integrate with an Existing Service:
● The existing service will call this API by making an
20
HTTP POST request to the API endpoint with the image
E,
data and desired dimensions.
SC
M
import requests
import base64
,B
import json
SE
image_data = image_file.read()
t
ep
image_base64 =
D
base64.b64encode(image_data).decode('utf-8')
payload = {
'image': image_base64,
'width': width,
'height': height
}
api_url =
'https://{api-id}.execute-api.{region}.amazo
naws.com/prod/images'
Dept of ISE, BMSCE, 2025 99
response = requests.post(api_url,
data=json.dumps(payload),
headers={'Content-Type':
'application/json'})
if response.status_code == 200:
resized_image_base64 =
response.json()['resized_image']
resized_image_data =
base64.b64decode(resized_image_base64)
with open('resized_image.jpg', 'wb')
as resized_image_file:
resized_image_file.write(resized_image_data)
print("Image resized successfully!")
else:
print("Failed to resize image:",
response.json()['error'])
25
resize_image('path/to/your/image.jpg', 100,
20
100)
import base64
SE
def encode_image_to_base64(image_path):
fI
return
t
base64.b64encode(image_data).decode('utf-8')
ep
D
encoded_image =
encode_image_to_base64('path/to/your/image.jpg')
curl -X POST \
https://{api-id}.execute-api.{region}.amazon
aws.com/prod/images \
25
-H "Content-Type: application/json" \
20
-d @payload.json
E,
SC
M
,B
SE
fI
t .o
ep
D
25
20
E,
SC
M
,B
SE
fI
t .o
ep
D