HPC Exam 2

0.0(0)
Studied by 13 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/82

encourage image

There's no tags or description

Looks like no tags are added yet.

83 Terms

1
New cards

DSPS =

Distributed Stream Processing Systems

2
New cards

DSPS is

Groups of operator blocks deployed in distributed processing nodes.

3
New cards

DSPS is represented as

A directional acyclic graph with parentheses around operator block groupings.

4
New cards

Eight Requirements of Stream Processing

  1. Keep the data moving

  2. Query using SQL on Streams

  3. Handle Stream imperfections

  4. Generate predicatble outcomes

  5. Integrate stored and streaming data

  6. Guarantee data safety and availability

  7. Partition and scale applications automatically

  8. Process and respond instantaneously


5
New cards

The Publish-Subscribe (Pub-Sub) model provides

decoupling among producers and consumers.

6
New cards

In the pub-sub model

Producers are called publishers and consumers are called subscribers (along three dimensions)

7
New cards

The Pup-Sub Model saves on

  1. Time

    1. As nodes to not have to be up and running at the same time

    2. They can come and go anytime similar to P2P

  2. Space

    1. They do not need to be aware of each other

  3. Synchronization

    1. Nobody blocks for the other


8
New cards

Advantages of Pub/Sub

  • Three dimensions of decoupling enable

    • Increased scalability

    • Improved resilience

    • Reduction in Coordination


9
New cards

Basic Terminology of Pub/Sub

  • Event

    • Is the information generated yb the publisher that must be delivered to the subscriber

  • Notification

    • The act of alerting the subscriber of an event of interest to that subscriber

  • Event Service

    • Manages the storage of events and deliver of events form publisher to subscribers

    • Serves as a proxy for both the publisher and subscriber



10
New cards

The modes of Pub/Sub

The mode is based on what is pushing or pulling (taking responsibility of) an event from the event service.

There is:

  • Publisher-side push

    • Pushes to event service

  • Publisher-side pull

    • Event service pulls form publsiher

  • Subscriber-side push

    • Event service pushes to subscriber

  • Subscriber-side pull

    • Subscriber pulls from event service

REMEMBER THIS ^^

11
New cards

Types of Pub/Sub Models

  • Topic-based

    • Based on events that are named or have an ID

  • Content-based

    • Based on the contents of the event

  • Type-based

    • Similar to topic-based but provides a programming language level type instead of some name

  • Data-Centric

    • A variant that is a hybrid of the above three


12
New cards

Topic Based Pub/Sub

  • Every event has a unique name such as a URL

  • Simple interfaces

  • Hierarchal addressing is supported.

    • Formed via containment

  • Each maps to a virtual channel

  • Each is identified by a key

  • Strings are usually used as keys (not a requirement)

  • keys help divide the event space into granularities based on that key.


13
New cards

Content-Based Pub/Sub

  • Provides finer granularity by subscription based on the actual content

  • Subscription for content is specified using filters.

  • Complex filters can be constructed using comparison and logical operators.

  • More sophisticated implementations may incur more runtime overhead


14
New cards

Type-Based Pub/Sub

  • Events are recognized as types in the programming language

  • Improves safety

  • Compile-time error checking can be done as opposed to at runtime

  • Any filtering is still the responsibility of the subscriber but we get type safety.


15
New cards

Different types of Lookups

  • Centralized

  • Flooding-based

  • Distributed Hash Table (DHT)


16
New cards

Centralized Lookup

  • A broker maintains information of a specific service and how to access it

  • In the networking world the DOmain Name System is used to lookup the host

  • In CORBA world we have the Naming and Trading Service

    • A object reference and key is registered with the broker

  • In web services Universal Description Discovery and Integration is used

    • Web services registers register with UDDI

    • SOAP messages are used


17
New cards

Pros of the Centralized Lookup

  • Simple architecture

  • O(1) lookup time


18
New cards

Cons of the Centralized Lookup

  • O(N) storage complexity since information for N services must be maintained at a single place.

  • Single broker can become a bottleneck for large systems involving frequent lookups

  • Failure of the broker will render system useless.


19
New cards

Flood-Based Lookup

An alternative to the centralized broker where multiple queries are sent across the network hoping someone responds

20
New cards

Pros to Flooding-based Lookup

  • Nodes can join and leave the network at any time

  • No single point of failure yielding a resilient architecture

  • Storage cost is only O(1) as only the node that offers the service maintains the information


21
New cards

Cons of Flooding Based Lookup

  • Network links can get congested due to too many search messages.

  • No proper way to stop unwanted propagation of messages

  • May often be limited by routers/bridges in how much information is allowed to spread resulting in some lookups having a chance to not succeed


22
New cards

Address Resolution Protocol (ARP) is a well known ___

Flooding-based lookup approach

23
New cards

Distributed Hash Table (DHT) Lookup

  • Concept of hashing applied in a distributed sense.

  • Attempts to bring the advantages of both centralized and flooding lookup approaches into one solution while minimizing disadvantages

  • Achieves O(log(N)) complexity for both storage and traffic/processing

  • Architecture is inherently resilietn to failures.


24
New cards

A DHT is made up of

A set of nodes.

25
New cards

DHT Nodes

  • Store roughly O(log(N)) information of services and their data that have registered with that node

  • Maintains a route to the next hop in the DHT system

  • As long as a service is registered with a node it is guaranteed to succeed.


26
New cards

DHT API

  1. Put (Key, Value)

    1. Key is the hash value of the data that the service wants to store

    2. Values is the actual value to be stored

  1. Value = Get (Key)

    1. Entity that is doing the lookup uses some name and hashes it ot the key that is used for the lookup.

    2. Value is returned


27
New cards

Issues of importance in DHT

  • Node arrival

    • Routing tables must be updated to distribute the load

  • Node failure

    • (key, value) pairs associated with the node must somehow be distributed across remaining nodes

  • Node departure

    • Similar to failure but the node informs the system ahead of time and proactive steps are taken.


28
New cards

Consistent Hashing has the following properties

  • Collision free

  • O(1) time

  • Each node and key is assigned an m-bit identifer

  • m is assumed ot be large enough to ensure collision-free


29
New cards

Logic Ring

Following the properties of consistent hashing nodes are set up in a ring.

  • Identifiers are arranged on this using mod( 2^m)

  • Key k is assigned to the identifier node equal to or immediately following this key. This is called the successor node.

    • Key 10 cannot go to Node 8, but it can go to its successor which is Node 14.

  • When a node leaves its keys are assigned to its successor

  • When a node joins some keys that were at the successor will get assigned to the new node.


30
New cards

Chord Leverages consistent hashing by adding

A finger table

31
New cards

A finger table is

A table that tracks successor nodes of a given node in a logic ring.

  • A routing table of max m entried where m = lg(N) >= 0 (lg(N) space complexity)

  • The ith entry of node n in the table is the first ndoe s who succeeds n by at least 2^(i-1) distance.

    • The first sucessor

    • Node s is called the ith finger of Node n



32
New cards

Chord Protocol

  • it is a scalable lookup idea

  • As the circle looks bigger the finger entries of a finger table must be spred out to cover as much of the circle as possible so that the iterative search process should not be more than O(lg N) steps.

  • Even if a node does not know the key such as node 3 not knowing node 50 it can throw it to a node as close as possible to node 50


33
New cards

Key Properties of the Finger Table

REMEMBER THIS

  • The finger table entries are not the next m consecutive nodes

  • Tries to jump as far away as possible

  • Jump distance increases by 2^n


34
New cards

Coordination Issues

  • Leader Election

  • Configuration Management

  • Group Membership

  • Distributed Resources Locking


35
New cards

Common Coordination Services

  • Zookeeper

  • Etcd

  • Consul

  • doozerd


36
New cards

Zookeeper Design Rationale

  • provide a basic kernal upon which applications can build more sophisticated coordination mechanisms

  • Move away from server oriented models

  • Move away from blocking so the entire service isnt slowed down just from some components being slower

  • Support for FIFO request ordering


37
New cards

Participants and Service Model of Zookeeper

  • Client: uses the service

  • Server: process that provides the service

    • Typically implemented as an ensemble of replicated servers for the sake of load balancing and fault tolerance

  • Session: Duration of time when the client connects to the server and access the services until closing

  • znode: an in-memory data objected used by the service to store metadata for the clients application

REMBER ZNODES EXISTS AND DO ALOT


38
New cards

Two Types of Znodes

  • Ephemeral node

    • Remain alive for the session and can be deleted by client or automatically cleaned on session termination

  • Regular node

    • created/deleted explicitly by the user


39
New cards

Coordination Requirements

  • Wait free data objects

    • Improves performance

    • If a collection of processes ere to coordinate among themselves and used blocking, the performance will be dictated by the slowest processes

  • Pipelined Architecture and FIFO Ordering

    • Enables clients to submit operations asynchronously instead of a request-response blocking model

  • Linearizeable Writes

    • A legitamate/legal sequential computation

    • A system is linearizeable if each individual object is linearizeable

    • Allows multiple requests form the same client to be outstanding however FIFO is still ensured


40
New cards

The Watch Mechanism

  • ZooKeeper uses event notification to inform the clients when a condition becomes true rather than the clinet polling

  • Watches are installed on a znode that the clinet creates for its needs.

  • After a watch has given a notification the client must set the watch again


41
New cards

Function Definition

Indicates what a system is supposed to do

42
New cards

Behavior Definition

The actions of the system that implement the function

43
New cards

Structure Definition

What generates the behavior of the system

44
New cards

Key Concepts for Discussing Fault Tolerance

  • Service: the behavior of a system observed by its users

  • Correct Service: the conformance to its functional specification

  • Service Failure: The event that causes the service to deviate from its correct behavior

  • Service Outage: the time period when incorrect service is delivered

  • Service Restoration: transition from incorrect to correct service

  • Failure Modes: different forms that influence the service to deviate from its correct behavior.

  • Failure: The event that causes the service to deviate from its correct behavior

  • Error: the deviation from correct behavior

  • Fault: cause of an error


45
New cards

Dependability is the ability to deliver a service that can be trusted and is comprised of:

  • Availability: tells if the service is ready for use in a correct manner

  • Reliability: tells whether the service is continuing to work correctly

  • Safety: indicates absences of any catastrophic consequences on the user and environment

  • Integrity: Indicates absence of any improper alterations to the system behavior

  • Maintainability: ability to make modifications and repairs both at development time and during use


46
New cards

Replication

  • Achieving fault tolerance through redundancy by having multiple running replicas of the same server.


47
New cards

Passive Replication

  • One replica chosen as a primary that executes client requests

  • Backup replicas do not execute requests, thereby conserving resources, but only synchronize state of the primary.

  • Replica manager manages replica groups

  • Faults monitored by detector and informed to replica manager

  • Backup promotion done by replica manager on primary failure

REMEMBER THIS


48
New cards

Cold Passive Replication

State is transferred only when a backup is promoted to primary

REMEMBER THIS

49
New cards

Warm Passive Replication

State is transferred periodically into designated backups

REMEMBER THIS

50
New cards

Active Replication

  • Client request gets multicast to each replica

  • Each replica executes the request

  • Multiple responses are not sent to the client, instead logic is used to suppress duplicates

  • Often majority voting is implemented on replies coming from replicas


51
New cards

Semi-Active Replication

  • Several replicas chained together but only one is primary

  • Client sends request to primary

  • State is reliably multicast to all secondaries periodically

  • Response sent to client

  • First secondary in chain becomes new primary when current primary fails

  • Replica manager may be used to preserve degree of replication

  • External storage may be used



52
New cards

Framework Elements needed for Fault Tolerance

  • Replication Management

  • Group Communications

  • State Checkpointing

  • Insertion into Application

  • Fault Detection


53
New cards

Capabilities for Supporting Fault Tolerance

  • A way to create and manage copies of functionality

  • A way to talk to a set of replicas

  • A way to checkpoint and restore state

  • A way to trigger checkpointing and/or state exchange when needed

  • A way to insert FT capabilities into an application and/or system

  • A way to detect faults and trigger recovery


54
New cards

The letters in CAP stand for

  • Consistency

  • Availability

  • (network) Partition tolerance



55
New cards

The original CAP theorem stated that

Any netwokred shared data system could only have two of the three desired properties.


This is outdated as the theorem was more meant to illustrate the flexibility of a shared data system that can make tradeoffs along the three dimensions. So given the presence of one of the properties, maximize a combination of the other two properties.

56
New cards

The letters in ACID stand for

  • Atomicity

    • No partial operations

  • Consistency

    • One valid state to another

  • Isolation

  • Durability

    • Once a transaction has been committed its effect will persist.



57
New cards

ACID properties are crucial for

Database Transactions

58
New cards

ACID focuses on

Consistency

59
New cards

Letters in BASE stand for

  • Basicaly

  • Available

  • Soft State

  • Eventually Consistent


60
New cards

BASE is designed with

Availability in Mind

61
New cards

Soft State and Eventual Consistency are useful when

Systems get partitioned.

62
New cards

Why is Latency important?

It can be used to determine if a system is partitioned or not.


If a system cannot maintain full consistency wihtin a bounded set of time, then it is declared as partitioned keeping the system available and subsequently handle recovery.

63
New cards

How is the system brought into a consistent state after recovery?

REMEMBER THIS

We look at clocks and the logical clocks. If there is a counter and when something happens that counter is incremented and a timestamp is attached to the increment. When the system catches backup, it checks any new counts and their timestamps and puts the event in the correct order according to the time stamp.

64
New cards

Paxos is a

Consensus algorithm designed to recover from faults. (REMEMBER THIS)

65
New cards

Paxos works in cases where

  • Processes/processors may stop and restart at some point

  • Messages may get delayed, lost, or duplicated

  • Corruption of messages



66
New cards

The three requirements of consensus for Paxos

  • Termination (process must end at some point in time)

  • Agreement (must agree on the value)

  • Validity (the agreed upon value must have been actually proposed by one of the members of the group)


67
New cards

Roles in Paxos

  • Proposers (agents who propose values)

  • Acceptors (agents who accept specifc values)

  • Learners (Agents who finally learn the consensus value)


68
New cards

Paxos Algorithm

  • Proposer selects a proposal number n and sends a prepare request to a majority of acceptors

  • If an acceptor recieves a request with n greater than any other request n then it agrees not accept any other request with values less than n

  • If a proposer receives a response to its prepare request from a majority of acceptors, then it sends an accept request to each of those acceptors.

  • If an acceptor receives an accept request for a proposal numbered n it accepts it unless it has already responded to a prepare request having a number greater than n

  • All acceptors after accepting the value will send the accepted value and proposal number to a distinguished learner who will then share it to other learners.

REMEMBER THIS


69
New cards

The Byzantine General Problem (BGP) at a high level.

  • Traitors exist in the “army”

  • Despite traitors loyal generals must reach agreement

  • All loyal generals decide on the same plan of action via consensus

  • A sall number of traitors cannot cause the loyal generals to adopt a bad plan


70
New cards

Detailed BGP

  • Let there be n generals

  • The generals communicate with each other

  • Each ithe geneeral sends a value to the remaining generals

  • On receiving all values, each general combines these values into a plan

  • The function is agreed upon by all generals and the function itself is not manipulated.


71
New cards

BGP is designed for

Fault tolerance not full stop handling.

72
New cards

BGP and Paxos are similar in that they both

  • Are distributed

  • About reaching consensus

  • Execute in phases

  • Both require final decision to be obeyed

  • No corruption on the link or a man-in-the-middle


73
New cards

BGP and Paxos are different in that

  • Messages cannot be corrupted in Paxos

  • Messages can be lost in Paxos with no need to detect them

  • Messages can be delayed and ignored in Paxos. BGP needs messages from all generals.


74
New cards

Messages for BGP are sent in

Plain Text

75
New cards

In a practical implementation, of BGP

The messages are encrypted.

76
New cards

Logical Clocks

  • Assume every process clock ticks through every number

  • A process can start at any number it wants

  • A tick is assumed to occur between any two events

  • The value assigned to an event is the most recent preceding tick value on that process.


77
New cards

Implementation Rules for logical clocks

  • Each process increments it clock between two consecutive events

  • Each outgoing message contains a timestamp.

  • If a process receives a message with a timestamp it sets its local clock to greater than or equal to its present value and certainly greater than the timestamp of the message

    • Ensures the receiving process’s clock is logically synched up with the sending process.


78
New cards

While logical clock measure time as discrete units (ticks) they ocassionaly need to compare

Continuous times

79
New cards

Reference clock

A physical clock of an external observer with a frequency where all timing measurements are made in relation to the reference clock. Usually the frequency is 10^15 microticks/sec


Used to measure the granularity of another clock

80
New cards

Microtick

The periodic event generated by the oscillator

81
New cards

Digital clock

An oscillator that generates an event periodically which in turn increments a counter

82
New cards

Macrotick

Some subset of microticks from a collection of clocks (e.g. 10 microticks)

83
New cards

Precision

  • How much clocks drift from each other

  • Clocks must be internally synched to provide a certain level of procision