DS ARCHITECTURES
Architectural Styles
It is the Logical organization of distributed systems into
software components
Such a style is formulated in terms of components:
How components are connected to each other,
The data exchanged between components
How these elements are jointly configured into a
system.
Layered architectures
Components are organized in a layered fashion where a
component at layer L; is allowed to call components at
the underlying layer but not the other way around
An key observation is that control generally flows from
layer to layer:
The layers on the bottom provide a service to the layers
on the top.
The request flows from top to bottom, whereas the
response/results is sent from bottom to top
Layered architectures cont’d
A well known example for this is the OSI model that
incorporates a layered architecture when interacting with
each of the components.
Each interaction is sequential where a layer will contact the
adjacent layer and this process continues, until the request
is been catered to
The advantage of using this approach is that, the calls
always follow a predefined path, and that each layer can be
easily replaced or modified without affecting the entire
architecture.
Layered architectures cont’d
The following image is the basic idea of a layered
architecture style.
Object-based architectures
Each of the components are referred to as objects, and these
components are connected through a (remote) procedure call
mechanism/ interact with other objects through a given connector or
interface.
This architecture style is based on loosely coupled arrangement of
objects. This has no specific architecture like layers.
These are much more direct where all the different components can
interact directly with other components through a direct method call.
Examples: REST API Calls, Web Services, and Java RMI
Object-based architectures cont’d
Data-centered architectures
Evolve around the idea that processes communicate
through a common repository.
This common repository can be either active or passive
This is more like a producer consumer problem.
The producers produce items to a common data store, and
the consumers can request data from it.
This common repository, could even be a simple database.
Data-centered architectures cont’d
For example, a wealth of networked applications have been
developed that rely on a shared distributed file system in which
virtually all communication takes place through files.
Likewise, Web-based distributed systems are largely data-
centric: processes communicate through the use of shared Web-
based data services.
Communication between objects happens through shared common
storage.
This supports different components (or objects) by providing a
persistent storage space for those components (such as a MySQL
database).
Data-centered architectures cont’d
All the information related to the nodes in the system are stored in
this persistent storage.
Event-based architectures
Event-Based Architecture is almost similar to Data
centered architecture just the difference is that in this
architecture events are present instead of data.
Events are present at the centre (Middleware) in the Event
bus and delivered to the required component whenever
needed, thus the entire communication is done through
events.
Event propagation has generally been associated with what
are known as publish/subscribe systems.
Event-based architectures Con’t
The basic idea is that processes publish events after which
the middleware ensures that only those processes that are
subscribed to those events will receive them.
Processes are loosely coupled that’s why it is easy to add,
remove and modify them.
Event-based architectures Con’t
This architectural style is based on the publisher-subscriber
architecture. Between each node there is no direct communication
or coordination. Instead, objects which are subscribed to the service
communicate through the event bus.
SYSTEM ARCHITECTURES
Addresses the question of where software components
are placed; their interaction, and their placement.
Centralized
Decentralized
Distributed
Centralized Architectures
Client Server Model
The two main structures within distributed system overlays
are Centralized and Decentralized architectures.
The centralized architecture can be explained by a simple
client-server architecture where the server acts as a central
unit and one or more client nodes are directly connected to
it.
Centralized Architectures cont’d
Centralized Architectures cont’d
Client Server Model e.g. search engine
The user-interface level
The processing level
The data level
Characteristics of Centralized System
Presence of a global clock: As the entire system consists of a
central node(a server/ a master) and many client nodes(a
computer/ a slave), all client nodes sync up with the global
clock(the clock of the central node).
One single central unit: One single central unit which
serves/coordinates all the other nodes in the system.
Dependent failure of components: Central node failure causes the
entire system to fail. This makes sense because when the server is
down, no other entity is there to send/receive responses/requests.
Advantages of Centralized System
Easy to physically secure – It is easy to secure and service the server
and client nodes by virtue of their location.
Smooth and elegant personal experience – A client has a dedicated
system which he uses(for example, a personal computer) and the
company has a similar system which can be modified to suit custom
needs
Dedicated resources (memory, CPU cores, etc)
More cost-efficient for small systems up to a certain limit – As the
central systems take fewer funds to set up, they have an edge when
small systems have to be built
Quick updates are possible – Only one machine to update.
Easy detachment of a node from the system – Just remove the
connection of the client node from the server and voila! Node
detached.
Applications of Centralized System
Application development – Very easy to set up a
central server and send client requests. Modern
technology these days do come with default test servers
which can be launched with a couple of commands. E.g.
Express server, Django server.
Data analysis – Easy to do data analysis when all the
data is in one place and available for analysis
Personal computing –
Use Cases
Centralized databases – all the data in one server for
use.
Single-player games – an entire game in one
system(commonly, a Personal Computer) e.g. Need For
Speed, GTA Vice City.
Application development – by deploying test servers
leading to easy debugging, easy deployment, easy
simulation
Personal Computers –
Decentralized Architectures
In decentralized systems, every node makes its own decision.
The final behavior of the system is the aggregate of the decisions of
the individual nodes.
NB: No single entity
Example:
Bitcoin. Let’s take Bitcoin for example because it is the most popular use case of
decentralized systems. No single entity/organization owns the bitcoin network. The
network is a sum of all the nodes who talk to each other for maintaining the
amount of bitcoin every account holder has. that receives and responds to the
request.
Decentralized Architectures Con’t
Figure – Decentralized system visualization.
Characteristics of Decentralized System
Lack of a global clock: Every node is independent of each
other and hence, has different clocks that they run and
follow.
Multiple central units (Computers/Nodes/Servers): More
than one central unit which can listen for connections
from other nodes.
Dependent failure of components: one central node
failure causes a part of the system to fail; not the whole
system.
Advantages of Decentralized System
Minimal problem of performance bottlenecks occurring – The
entire load gets balanced on all the nodes; leading to minimal or
even to no bottleneck situations.
High availability – Some nodes(computers, mobiles, servers) are
always available/online for work, leading to high availability.
More autonomy and control over resources – As each node controls
its own behavior, it has better autonomy leading to more control
over resources.
Applications of Decentralized System
Private networks – peer nodes joined with each other to
make a private network.
Cryptocurrency – Nodes joined to become a part of a
system in which digital currency is exchanged without
any trace and location of who sent what to whom.
However, in bitcoin, we can see the public address and
amount of bitcoin transferred, but those public
addresses are mutable and hence difficult to trace.
Use Cases
Blockchain –
Decentralized databases – Entire databases split
into parts and distributed to different nodes for
storage and use. For example, records with
names starting from ‘A’ to ‘K’ in one node, ‘L’ to
‘N’ in the second node, and ‘O’ to ‘Z’ in the third
node.
Cryptocurrency –
Distributed Architectures
A distributed system is a collection of computer programs that
utilize computational resources across multiple, separate
computation nodes to achieve a common, shared goal.
Also known as distributed computing or distributed databases, it
relies on separate nodes to communicate and synchronize over a
common network.
These nodes typically represent separate physical hardware devices
but can also represent separate software processes, or other
recursive encapsulated systems.
Distributed systems aim to remove bottlenecks or central points of
failure from a system.
Distributed Architectures
Example:
Google search system. Each request is worked upon by hundreds of computers
that crawl the web and return the relevant results.
To the user, Google appears to be one system, but it actually is multiple
computers working together to accomplish one single task (return the results to
the search query).
Characteristics of Distributed System
Resource sharing: A distributed system can share
hardware, software, or data.
Simultaneous processing: Multiple machines can process
the same function simultaneously.
Scalability: The computing and processing capacity can
scale up as needed when extended to additional
machines.
Error detection: Failures can be more easily detected.
Transparency: A node can access and communicate with
other nodes in the system.
Advantages of Distributed System
Low latency than a centralized system – Distributed
systems have low latency because of high geographical
spread, hence leading to less time to get a response.
Applications of Distributed System
Cluster computing – a technique in which many
computers are coupled together to work so that they
achieve global goals. The computer cluster acts as if
they were a single computer
Grid computing – All the resources are pooled together
for sharing in this kind of computing turning the
systems into a powerful supercomputer; essentially.
Use Cases
SOA-based systems.
Multiplayer online games.
Organizations Using –
Apple.
Google.
Facebook.
What is Middleware?
Middleware is the software between the application
programs and the operating System and base
networking
Integration Fabric that knits together applications,
devices, systems software, data
Middleware provides a comprehensive set of higher-
level distributed computing capabilities and a set of
interfaces to access the capabilities of the system.
More Views of Middleware
Are Software technologies that help manage complexity
and heterogeneity inherent to the development of
distributed systems, distributed applications, and
information systems
Provides Higher - level programming abstraction for
developing the distributed application
Middleware Systems – more views
Aims at reducing the burden of developing distributed application for
developer informally called “plumbing”, i.e., like pipes that connect
entities for communication often called “glue code”, i.e., it glues
independent systems together and makes them work together ; it
masks the heterogeneity programmers of distributed applications
have to deal with
network & hardware
operating system & programming language
different middleware platforms
location, access, failure, concurrency, mobility, ...
Often also referred to as transparencies, i.e., network transparency,
location transparency
Middleware Systems Views
Middleware Architecture