2 - Architectures Flashcards
Architectural Style: Definition
Components with well defined interfaces.
Relationships between components
Connector: Definition
Components
Mechanism that mediates comms between components
Architectural Styles: List of styles
Layered
Object based
Data centred
Event based
What is an example of a layered style?
The Internet Protocol stack
Object Based: Definition
Components are objects
Objects encapsulate data and offer methods
Objects may be on different machines
Object based: Communication method
RPC (Remote Procedure Call)
Object based: Examples
Common Object Request Broker Architecture
Java Remote Method Invocation
Object based: CORBA
Common Object Request Broker Architecture
Middleware that supports RPCs
Support of different platforms and languages
OOP approach but other programs possible
Object Based: RMI
Java Remote Method Invocation
Allows method calls between JVMs.
Locally or multiple computers
Platform independent
Data centred: Definition
Shared data approach
Communicate via a repository
Common in web apps
Data centred: Examples
RESTful Architecture
Amazon Simple Storage Service
Data centred: RESTful Architecture
Collection of resources managed by components.
Resources added, removed, retrieved and modified by remote apps
Data centred: Amazon S3
Simple Storage Service
Objects stored in buckets
Operations sent as HTTP requests
Event based: Definition
(pub/sub)
Publish/Subscriber systems (queues)
Components publish messages on an event bus
Components subscribe to event bus while specifying desired type
Event based: Do components/processes have explicit references?
No
Event based: Example
OpenStack Cloud Software
Data centred (Database)
Event Based (Message Broker)
Middleware: Definition
Software layer on top of the OS
Adds additional services LIKE comms and I/O routines
Can handle replication-related tasks
Makes using different (heterogeneous) hardware easier
Middleware: Transparency
OS and hardware hidden by middleware
Middleware: Design Patterns
(two different design types)
Wrapper - Offers client app interface
Interceptor - Breaks flow of comms to allow other code to exec
Middleware: Example
Object-based system
App calls method doit of obj B. App is unaware of B’s location.
Call intercepted and sent to object B
Centralised Arch: Definition
Uses a central coordination system to direct services
Centralised Arch: Examples:
Application Layering
Client server and multi- architectures
Two tiered configurations
Peer to Peer (P2P): Definition
In terms of the load
Horizontal distribution of components and load (not vertical)
P2P: Asymmetric or symmetric?
Symmetric. Processes are servers and clients simultaneously
P2P: Centralised or decentralised?
Decentralised
P2P: Structured or unstructured?
Either!
Hypercube: Definition
Structured P2P which can be used to store data
Hypercube: Common practice for location identification
Use a hash funciton to map data items to keys identifying the node location
Key(item) = hash(item’s value)
Chord: Organisation shape
Ring
Chord: Data location (eg for virtual nodes)
Data with key k is stored at the node with the smallest id >= k (successor)
Chord: Successor
Next node with the smallest identifier greater than or equal to the key number
Overlay Network: Definition
Virtual Network on top of a physical network.
Links usually not physical but path of physical links
Unstructured P2P: Nodes maintain what? What does the overlay resemble?
Each node maintains a list of neighbours and the resulting overlay resembles a random graph
Unstructured P2P: Search Types
Random Walks
Flooding
Unstruct. P2P: Random Walks
Send request to random neighbour, v
if v has data then send back and stop
else repeat for another neighbour
Unstruct. P2P: Flooding
Send request to all neighbours (v) with reduced hop counter
If v has data, has seen request before or hop counter = 0 then stop and send back data (if applic.)
If not v forwards to all neighbours
If there are N nodes in a unstruct. P2P net with r nodes having the correct data, what is the expected number of nodes to be checked? Random walk vs Flooding
Random = N/r
Flooding = Smallest k that fulfills d*(d-1)k-1>=N/r
Flooding vs Random Walk
Flooding is faster but sends more messages.
Data may be found but child processes only stop when hop counter = 0 and the hop counter must be larger than the expected number of steps (wasted messages)
Superpeer: What problem are they trying to solve?
Searching in unstructured networks is resource-intensive
Superpeer: Concept
Introduce partial-structures which form a backbone net.
Each (weak) peer is assigned to a superpeer that keeps an index
All comms are via superpeers
Superpeer: Problem
Failure of a superpeer can be fatal so backups are required.
Adaptive Systems: List
Feedback Control Model
Content Delivery Networks
Feedback Control Model
Used to automatically adjust a distributed system by analysing metrics which are compared to a reference output.
If necessary, corrections are issued
Content Delivery Network
Large, automatically adjusting media delivery systems
System decides whether to replicate content and where.
Three tiered approach. Layers
Interface
processing
data
Flooding how not to waste messages
Set the initial hop counter to exactly the diameter of the network (otherwise to ensure finding the data, it must be at least the diameter)
What kind of overlay network might you choose for broadcasts/multicasts?
Acyclic Graph - a tree so there’s only single paths to nodes.
Middleware in terms of layers
Above transport but below application layer