0% found this document useful (0 votes)
16 views36 pages

Chapter 3 Service Oriented Architectures

This document discusses Service-Oriented Architecture (SOA), defining it as a business-centric IT approach that integrates services for modularity, reusability, and interoperability. It outlines the principles, benefits, and challenges of SOA, emphasizing its role in enhancing business agility and scalability while addressing complexities in service management and integration. Examples of SOA applications, such as AWS and Netflix, illustrate its practical implementation in modern software development.

Uploaded by

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

Chapter 3 Service Oriented Architectures

This document discusses Service-Oriented Architecture (SOA), defining it as a business-centric IT approach that integrates services for modularity, reusability, and interoperability. It outlines the principles, benefits, and challenges of SOA, emphasizing its role in enhancing business agility and scalability while addressing complexities in service management and integration. Examples of SOA applications, such as AWS and Netflix, illustrate its practical implementation in modern software development.

Uploaded by

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

Selected Topics in

Computer Science
CHAPTER 3 SERVICE
ORIENTED
ARCHITECTURE
What is (Software)
Architecture?
⚫ Software architecture is the fundamental
organization of a system, embodied in its
components, their relationships to each
other and the environment, and the
principles governing its design and evolution.
- IEEE 1471-
2000

2
What is
Service ?
⚫ A mechanism to enable access to one
or more capabilities
⚫ using a prescribed interface
⚫ consistent with constraints and policies as
specified by the service description.
⚫ Windows service : RPC Locator, Event Log
⚫ Software Service: Distribution, Alert, Log

3
Service
Question -
Answer

Question/
Request

Present Audien
er ce

Answer/
Response
4
So SOA
is :
⚫ A business-centric IT architectural
approach that supports integrating your
business as linked, repeatable business
tasks, or services. - IBM
⚫ Service Oriented Architecture is a
paradigm for organizing and utilizing
distributed capabilities that may be
under the control of different
ownership domains.

5
Components of SOA
Ref: Element
of SOA SO
A

Service
Front Servic Service
End e Bus
Reposito
ry

Contra Implementati Interfa


ct on ce

Business Dat
Logic a

6
Architectural
Principles
⚫Loose coupling - Services maintain a
relationship that minimizes
dependencies and only maintain an
awareness of each other
⚫Service contract - Services adhere to a
communications agreement as defined
collectively by one or more service
description documents
⚫Service abstraction - Beyond what is
described in the service contract,
services hide logic from the outside
world
7
Architectural
Principles…
⚫ Service composability - Collections of services can be coordinated and
assembled to form composite services
⚫ Service autonomy – Services have control over the logic they
encapsulate
⚫ Service optimization – All else equal, high-quality services are
generally considered preferable to low-quality ones
⚫ Service discoverability - Services are designed to be outwardly
descriptive so that they can be found and assessed via available
discovery mechanisms

8
Business
Benefits
Modularity and Reusability:
SOA decomposes software systems into modular services that encapsulate
specific functionality. These services can be reused across multiple applications.
Example: A payment processing service can be reused across e-commerce
platforms, mobile apps, and point-of-sale systems.
Interoperability:
SOA promotes interoperability by enabling services to communicate with each
other using standardized protocols and data formats.
Example: A web service built using SOAP/XML can easily interact with a RESTful
service through HTTP, allowing different technologies to work together
seamlessly.

9
Business Benefits
Scalability:
◦ SOA facilitates scalability by allowing services to be distributed across
multiple servers and scaled independently based on demand.
◦ Example: A social media platform can scale its messaging service separately
from its authentication service to handle peak loads during events or
promotions.

Flexibility and Agility:


◦ SOA enables organizations to respond quickly to changing business
requirements by allowing services to be modified, added, or removed
without impacting other parts of the system.
◦ Example: An e-commerce platform can introduce new payment gateways or
shipping providers without rewriting the entire application by integrating
new services into the existing architecture.
Business Benefits
Service Composition and Orchestration:
◦ SOA allows complex business processes to be modeled and automated by
composing or orchestrating multiple services together.
◦ Example: An online travel agency can orchestrate services for flight booking,
hotel reservation, and car rental to create end-to-end travel packages for
customers.

Improved Maintainability and Manageability:


◦ SOA simplifies maintenance and management tasks by encapsulating
functionality within individual services and providing a clear separation of
concerns.
◦ Example: A healthcare system can update its patient management service
without affecting other services, making it easier to troubleshoot and deploy
changes.
Business Benefits
Platform and Technology Agnosticism:
SOA allows organizations to choose the most appropriate
technologies and platforms for implementing individual
services, enabling greater flexibility and avoiding vendor
lock-in.
Example: A financial institution can use Java for some
services, .NET for others, and Python for analytics,
depending on the requirements of each service.
Examples of SOA:

Amazon Web Services (AWS): AWS provides various


services such as Amazon S3 for storage, Amazon EC2 for
computing, and Amazon RDS for databases. These services
can be used independently and are accessible over the
internet through APIs.
Salesforce: Salesforce is a CRM (Customer Relationship
Management) platform that provides various services such
as sales management, customer support, and marketing
automation. These services can be integrated with other
applications using APIs.
Examples of SOA:
Google Maps API: Google Maps provides a set of services
such as geocoding, routing, and mapping that can be
integrated into web and mobile applications. Developers
can use these services to embed maps and location-based
features into their applications.
Netflix: Netflix uses a microservices architecture, which is a
variant of SOA, to build its streaming platform. Various
services such as user authentication, content
recommendation, and video streaming are developed and
deployed independently, allowing Netflix to scale its
platform efficiently.
Examples of SOA:
Enterprise Service Bus (ESB): An ESB is a
middleware tool used to integrate various
applications and services within an enterprise. It
acts as a communication layer between different
systems, enabling them to exchange data and
messages in a standardized manner.
Driver
s
The adoption of Service-Oriented Architecture (SOA) is driven by
various factors that reflect the needs and challenges of modern
software development and enterprise IT. Here are some notes and
examples on the drivers of SOA:
Business Agility:
Businesses need to respond quickly to changing market demands
and opportunities. SOA enables agility by allowing organizations to
compose and recompose services to support new business
processes and models.
Example: A retail company may need to integrate new sales
channels, such as mobile apps or online marketplaces, quickly and
efficiently. SOA allows the company to leverage existing services
and integrate them into new channels rapidly.

16
Drivers
Integration Challenges:
◦ Many organizations struggle with integrating diverse applications, systems, and data
sources. SOA provides a flexible and standardized approach to integration, enabling
seamless communication between disparate systems.
◦ Example: A manufacturing company may have legacy systems for inventory
management, production control, and supply chain management. SOA allows these
systems to exchange data and collaborate effectively, improving operational
efficiency.

Reusability and Cost Reduction:


◦ SOA promotes the development of reusable services that can be leveraged across
multiple applications and projects. This reduces development time and costs by
avoiding duplication of effort.
◦ Example: A financial institution can develop a single authentication service that
handles user login and access control for all its web and mobile applications. This
eliminates the need to implement authentication logic separately in each
application.
Drivers
Scalability and Performance:
◦ Traditional monolithic architectures may struggle to scale to meet increasing
demands. SOA allows services to be distributed and scaled independently,
improving scalability and performance.
◦ Example: An e-commerce platform experiences spikes in traffic during holiday
seasons. With SOA, the platform can scale its product catalog service, checkout
service, and payment processing service independently to handle increased load
efficiently.

Legacy Modernization:
◦ Many organizations rely on legacy systems that are difficult to maintain and
enhance. SOA provides a pathway for modernizing legacy applications by
encapsulating their functionality as services and exposing them through APIs.
◦ Example: A government agency may have a mainframe system for processing tax
returns. By implementing SOA, the agency can expose tax calculation and filing
services as web services, allowing taxpayers to submit returns electronically.
Drivers
Interoperability and Collaboration:
Businesses need to collaborate with partners, suppliers, and customers
who may use different technologies and platforms. SOA facilitates
interoperability by enabling seamless communication between
heterogeneous systems.
Example: A supply chain management system integrates with logistics
providers, manufacturers, and retailers. SOA allows the system to
exchange orders, shipments, and inventory data with external partners
using standardized protocols and interfaces.
Getting to
SOA
Developing a Service-Oriented Architecture (SOA) involves several key steps
and considerations to ensure that the resulting system meets the
requirements of the business and is well-designed for scalability, flexibility,
and interoperability.
Identify Business Processes and Services:
Start by identifying the core business processes and functionalities that
need to be implemented as services. Break down these processes into
granular, reusable components that can be encapsulated within
individual services.
Example: In an e-commerce platform, core business processes may
include product catalog management, order processing, payment
processing, and user authentication.

20
Getting to SOA
Define Service Contracts and Interfaces:
◦ Define clear service contracts that specify the inputs, outputs, and behaviors of
each service. Use standards-based protocols and data formats to define service
interfaces, such as SOAP/XML or REST/JSON.
◦ Example: The service contract for an authentication service may include
methods for user login, logout, and access control, along with the expected
input parameters and response formats.

Design for Loose Coupling and Modularity:


◦ Ensure that services are loosely coupled and independent of each other to
promote reusability and maintainability. Avoid tight dependencies between
services by defining clear boundaries and minimizing direct dependencies on
implementation details.
◦ Example: A shipping service should be independent of the order processing
service and should communicate with it through well-defined interfaces
without direct coupling.
Getting to SOA
Implement Services Using Appropriate Technologies:
◦ Choose technologies and platforms that are well-suited for implementing individual
services based on their requirements and constraints. Consider factors such as
performance, scalability, security, and interoperability when selecting technologies.
◦ Example: Use Java or C# for implementing business logic services, Node.js for
lightweight and scalable web services, and Python for data processing and analytics
services.

Implement Service Orchestration and Choreography:


◦ Define mechanisms for orchestrating and coordinating interactions between
multiple services to support complex business processes. Use tools such as
business process management (BPM) engines or workflow frameworks to
automate service orchestration and choreography.
◦ Example: An order processing system may use a BPM engine to coordinate
interactions between services for order validation, inventory check, payment
processing, and shipment tracking.
Ensure Scalability and Performance:
◦ Design services to be scalable and performant to handle varying loads and
resource demands. Consider techniques such as horizontal scaling, caching, load
balancing, and asynchronous processing to improve scalability and performance.
◦ Example: Use message queues such as RabbitMQ or Kafka for asynchronous
communication between services to decouple producers and consumers and
improve overall system scalability.

Implement Service Discovery and Registry:


◦ Implement mechanisms for service discovery and registry to facilitate dynamic
service invocation and composition. Use tools such as service registries or
discovery protocols (e.g., DNS-based service discovery) to enable services to
locate and communicate with each other dynamically.
◦ Example: Use a service registry such as Consul or Eureka to register and discover
services within a distributed system, allowing clients to locate and invoke services
based on their logical names.
Getting to SOA
Implement Security and Governance:
Ensure that services are secure and comply with organizational policies
and regulatory requirements. Implement authentication, authorization,
encryption, and auditing mechanisms to protect sensitive data and
prevent unauthorized access.
Example: Use OAuth or OpenID Connect for authentication and
authorization, implement role-based access control (RBAC) for fine-
grained access control, and encrypt sensitive data using SSL/TLS or AES
encryption algorithms.
Comprises
of
⚫ Services : a function or business processing
that is well-defined, self-contained, and
does not depend on the context or state of
other services
⚫ Loan Processing Service, Weather Forecast
Service
⚫ Connections : The link connecting
these self- contained distributed
services with each other.
⚫ For web services : HTTP and SOAP.

25
Service
Request -
Response Service
Director
y/
Register The Query For
Reposito Service
Service
ry
Servic Service
e
Provid Consum
er er
Invoke Service (via
Proxy)
26
Web Service Example Using
ASP.NET
<%@ WebService Language="VBScript" Class="TempConvert" %>

Imports System
Imports System.Web.Services

Public Class TempConvert :Inherits WebService


<WebMethod()>
Public Function FahrenheitToCelsius (ByVal Fahrenheit As String) As
String dim fahr
fahr=trim(replace(Fahrenheit,",","."))
if fahr="" or IsNumeric(fahr)=false then return "Error"
return ((((fahr) - 32) / 9)
* 5) end function

<WebMethod()>
Public Function CelsiusToFahrenheit (ByVal Celsius As String) As
String dim cel
cel=trim(replace(Celsius,",","."))
if cel="" or IsNumeric(cel)=false then return
"Error" return ((((cel) * 9) / 5) + 32)
end
function end
2
class
Web Service Example Using
ASP.NET
⚫ Test the Web service :
⚫ Celsius To Fahrenheit
⚫ Fahrenheit To Celsius
⚫ Remember :
⚫ SOA != Web service.
⚫ Web services can implement a service-
oriented architecture.

28
Challenges
Service-Oriented Architecture (SOA) offers numerous benefits, but it
also presents several challenges that organizations need to address to
successfully implement and maintain SOA-based systems. Here are
some challenges in service-oriented architectures:
Complexity Management:
SOA introduces additional complexity due to the distributed
nature of services, service interactions, and dependencies.
Managing this complexity requires careful design, governance,
and monitoring.
Example: In a large enterprise system, managing dependencies
between services, versioning, and ensuring backward
compatibility can become challenging as the number of services
and interactions grows.

29
Challenges
Service Discovery and Registry:
◦ Discovering and locating services dynamically within a distributed environment
can be challenging, especially as the number of services increases. Service
registries must be reliable, scalable, and up-to-date.
◦ Example: In a microservices architecture, ensuring that services can discover
and communicate with each other efficiently across different environments
(e.g., development, testing, production) requires robust service discovery
mechanisms.

Interoperability and Standards:


◦ Ensuring interoperability between heterogeneous systems, technologies, and
platforms can be challenging. Variations in standards, protocols, and data
formats may lead to integration issues and compatibility concerns.
◦ Example: Integrating legacy systems with modern cloud-based services may
require translating data formats, handling protocol differences, and addressing
compatibility issues to ensure seamless communication.
Challenges
Service Lifecycle Management:
◦ Managing the lifecycle of services, including development, deployment,
versioning, and retirement, requires effective governance and coordination
across teams and stakeholders.
◦ Example: Updating a critical service to a new version while ensuring backward
compatibility and minimizing disruption to existing consumers requires careful
planning, testing, and coordination.

Security and Compliance:


◦ Securing services and data in a distributed environment introduces additional
challenges related to authentication, authorization, data integrity, and privacy.
Compliance with regulatory requirements adds complexity.
◦ Example: Protecting sensitive data transmitted between services, enforcing
access control policies, and auditing service interactions to ensure compliance
with regulations such as GDPR or HIPAA are critical considerations.
Challenges
Performance and Scalability:
◦ Ensuring optimal performance and scalability in SOA environments requires careful design, resource
management, and scalability testing. Bottlenecks, latency issues, and resource contention may arise as the
system scales.
◦ Example: Handling spikes in traffic, optimizing service response times, and scaling services dynamically to
accommodate changing workloads are common challenges in large-scale SOA deployments.

Fault Tolerance and Resilience:


◦ Building resilient and fault-tolerant systems capable of handling failures, errors, and disruptions is
essential in SOA environments. Implementing strategies for fault detection, recovery, and graceful
degradation is challenging.
◦ Example: Implementing circuit breakers, retry policies, and fallback mechanisms to handle service failures,
network outages, and other unexpected issues helps maintain system stability and availability.

Organizational Change and Culture:


◦ Adopting SOA requires organizational changes, including cultural shifts, skill development, and
collaboration across teams and departments. Resistance to change and siloed mentalities may hinder
adoption.
◦ Example: Encouraging collaboration between development, operations, and business teams, fostering a
culture of innovation and learning, and providing training and support for new technologies and practices
are essential for successful SOA adoption.
Where Not to use
SOA
While Service-Oriented Architecture (SOA) offers many benefits,
there are situations where it may not be the best architectural
approach. Here are some notes and examples on where and
when not to use SOA:
Simple or Small-Scale Applications:
SOA adds complexity and overhead, which may not be
justified for simple or small-scale applications with limited
functionality and scope.
Example: A personal blog or a simple static website may not
benefit from the overhead of implementing services,
especially if the application does not require integration
with other systems or scalability.

33
Where Not to use SOA
Performance-Critical Systems:
◦ SOA introduces additional layers of communication and abstraction, which
can impact performance, especially in latency-sensitive or high-throughput
systems.
◦ Example: Real-time financial trading systems or online gaming platforms may
require low-latency, high-performance architectures that prioritize direct
communication and minimize overhead.

Monolithic Applications with Low Integration Needs:


◦ Applications with tightly coupled components or limited integration
requirements may not benefit significantly from the decoupling and flexibility
offered by SOA.
◦ Example: A standalone desktop application with a single-user interface and
minimal interaction with external systems may be better served by a
monolithic architecture.
Where Not to use SOA
Limited Budget or Resources:
◦ Implementing and maintaining a service-oriented architecture requires
investments in infrastructure, development, testing, and governance, which
may not be feasible for organizations with limited budget or resources.
◦ Example: Startups or small businesses with constrained resources may
prioritize simplicity, time-to-market, and cost-effectiveness over the
scalability and flexibility offered by SOA.

Organizations with Immature Development Processes:


◦ SOA requires disciplined development practices, robust testing frameworks,
and effective governance processes to manage complexity, ensure quality,
and maintain consistency.
◦ Example: Organizations with immature development processes, lack of
skilled resources, or resistance to change may struggle to adopt and manage
SOA effectively.
Where Not to use SOA
Legacy Systems with Limited Modernization Potential:
◦ Retrofitting legacy systems with SOA may be complex, costly, and risky,
especially if the systems lack modular design, standardized interfaces, or
support for interoperability.
◦ Example: Legacy systems built on outdated technologies or proprietary
platforms may have tightly coupled components, monolithic architectures,
and limited modernization potential, making SOA impractical or infeasible.

Applications with Low Change Frequency:


◦ SOA is beneficial for applications that require frequent changes, updates, or
extensions to support evolving business requirements and technological
advancements.
◦ Example: Intranet portals or internal tools with stable, well-defined
functionalities and limited change frequency may not justify the overhead of
implementing a service-oriented architecture.

You might also like