Chap 13 PDF
Chap 13 PDF
Architecture
Chapter 13: Patterns and Tactics
-Client-Server Pattern
-Service Oriented Architecture
-Map-Reduce Pattern
Client-Server Pattern
• Context: There are shared resources and services that large numbers of
distributed clients wish to access, and for which we wish to control access or quality
of service.
Client-Server Pattern
--The Clients initiate interactions with servers, invoking services as needed from
those servers and waiting for the results of those requests.
Client-Server Example
Client-Server Example
Client-Server Solution
• Elements:
– Client, a component that invokes services of a server component. Clients have
ports that describe the services they require.
– Server: a component that provides services to clients. Servers have ports that
describe the services they provide.
Client-Server Solution
• Weaknesses:
– Server can be a performance bottleneck.
– Server can be a single point of failure.
– Decisions about where to locate functionality (in the client or in the server) are
often complex and costly to change after a system has been built.
▰Usage
▰Online applications such as email, document sharing and banking
Service Oriented Architecture
What Is Service-Oriented Architecture?
Context: A number of services are offered (and described) by service providers and
consumed by service consumers. Service consumers need to be able to understand
and use these services without any detailed knowledge of their implementation.
Service Oriented Architecture
– Components:
• Service providers, which provide one or more services through
published interfaces.
• Service consumers, which invoke services directly or through an
intermediary.
• Service providers may also be service consumers.
Guiding Principles of SOA:
▰Standardized service contract: Specified through one or more service description documents.
▰Loose coupling: Services are designed as self-contained components, maintain relationships that minimize
dependencies on other services.
▰Abstraction: A service is completely defined by service contracts and description documents. They hide their
logic, which is encapsulated within their implementation.
▰Reusability: Designed as components, services can be reused more effectively, thus reducing development
time and the associated costs.
▰Autonomy: Services have control over the logic they encapsulate and, from a service consumer point of view,
there is no need to know about their implementation.
▰Discoverability: Services are defined by description documents that constitute supplemental metadata
through which they can be effectively discovered. Service discovery provides an effective means for utilizing
third-party resources.
▰Composability: Using services as building blocks, sophisticated and complex operations can be implemented.
Service orchestration and choreography provide a solid support for composing services and achieving business
goals.
Why Service-Oriented Architecture Is Important
Advantages of SOA:
▰Service reusability: In SOA, applications are made from existing services. Thus,
services can be reused to make many applications.
▰Easy maintenance: As services are independent of each other they can be
updated and modified easily without affecting other services.
▰Platform independant: SOA allows making a complex application by combining
services picked from different sources, independent of the platform.
▰Availability: SOA facilities are easily available to anyone on request.
▰Reliability: SOA applications are more reliable because it is easy to debug small
services rather than huge codes
▰Scalability: Services can run on different servers within an environment, this
increases scalability
Disadvantages of SOA:
▰SOA infrastructure is used by many armies and air force to deploy situational
awareness systems.
▰SOA is used to improve the healthcare delivery.
▰Nowadays many apps are games and they use inbuilt functions to run. For
example, an app might need GPS so it uses inbuilt GPS functions of the device.
This is SOA in mobile solutions.
Service Oriented Architecture Solution
Weaknesses:
Problem: For many applications with ultra-large data sets, sorting the data and then
analyzing the grouped data is sufficient. The problem the map-reduce pattern solves
is to efficiently perform a distributed and parallel sort of a large data set and provide
a simple means for the programmer to specify the analysis to be done.
Map-Reduce Pattern
Map-Reduce Pattern
• Weaknesses:
– If you do not have large data sets, the overhead of map-reduce is not justified.
– If you cannot divide your data set into similar sized subsets, the advantages of
parallelism are lost.
Map-Reduce Pattern
• Elements:
– Map is a function with multiple instances deployed across multiple
processors that performs the extract and transformation portions of
the analysis.
– Reduce is a function that may be deployed as a single instance or as
multiple instances across processors to perform the load portion of
extract-transform-load.
– The infrastructure is the framework responsible for deploying map and
reduce instances, shepherding the data between them, and detecting
and recovering from failure.