General Study Flashcards
(95 cards)
Explain the Pub/Sub Model (4 Features)
- Decoupling
- Messaging Server
- Asynchronous Communication
- Pub/Sub Model
What does the use of a queue model do to a Publish Subscribe Model
The use of a strict queue means that only one user will be able to read the message
Give an example of a publisher subscribe model.
Youtube Subscribers
What is a Local Conceptual Schema
A fragment of the global conceptual schema stored locally on site. Has its own local physical schema.
Advantages of Distribute + Replicate
Performance, Fault Tolerance, Scale Up, Application Related Aspects
When not to replicate
- When there is Low Replication Transparency
- When there is Data Consistency Issues
What is Update Propagation Protocol?
Set of rules for how changes/updates to data are propagated.
Synchronous/Primary Copy UPP:
Primary Copy
On Read: Read Locally and Return to User
On Write: Write locally, multicast to replicas
On Commit Req: Run 2PC Coordinator
On Abort: Abort + Inform other sites.
Secondary Copy
On Read: Read Locally
On Write from Client: Refuse or forward to primary.
On Write from Prim.: Write locally, multicast to replicas
On Commit Req: Commit locally
Participant of 2PC on primary
Synchronous/Primary Copy Advantages
- Updates don’t have to be coordinated
- No inconsistencies or Deadlocks
Synchronous/Primary Copy Disadvantages
- Long response time
- Useful only with few updates
- Local copies almost useless
- Not used in practise
Synchronous/Update Everywhere Advantages:
- No inconsistencies
- Elegant (Updates applied uniformly)
- Data Consistency
- Fault Tolerance
Asynchronous/Primary Copy
Primary Copy
On Read: Read Locally and Return to User
On Write: Write locally, return to user
On Commit/Abort: Terminate locally
After Commit: Multicast changed objects in single array.
Secondary Copy
On Read: Read Locally
On Write from Client: Refuse or forward to primary.
On Message from Prim.: Install changes in order
On Commit/Abort: Commit locally
Only local deadlocks
Asych/Primary Copy Advantages
- No coordination needed
- Short response time
- Good Performance
Asynch/Primary Copy Disadvantages
- Local Copies not updates
- Inconsistencies
- Limited Fault Tolerance
Asynch/Update Everywhere
Primary Copy
On Read: Read Locally and Return to User
On Write: Write locally, return to user
On Commit/Abort: Terminate locally
On msg from other site: Detect Conflicts
After Commit: Multicast changed objects in single array.
Secondary Copy
On Read: Read Locally
On Write from Client: Refuse or forward to primary.
On Message from Prim.: Install changes in order
On Commit/Abort: Commit locally
Only local deadlocks
Explain ROWA
Read One, Write All. Replication strategy where each site keeps local data copy and rules govern how operations are handled.
Concepts:
- Each Site uses 2PL
- Read Ops performed locally
- Write Ops performed at all sites
Reconciliation patterns
1) Latest Update Wins (Most recent update preferred when conflict occurs)
2) Site Priority (Prioritize Updates from HQ)
3) Largest Value (Prioritize Largest transaction)
Ad-hoc Reconciliation strategies
1) Identify Changes and try combine them
2) Analyze and eliminate unimportant transactions
3) Create your own priority schemas
Replication Protocols to deal with replications with failures
Site Failures -> Use ROWAA
Network/Comm errors -> Use Quorums
Quorum
Needs to reach a certain threshold of successful responses before considering a transaction committed.
ROWAA (Primary Site)
Read -> Read any copy, if timed out read another copy
Write -> Send write(x) to all copies. If a site rejects, abort. All sites that don’t respond are missing writes.
Validation -> To commit a transaction. Check if missing writes are still down, if no then abort. Also check if available sites are still available, if no then abort.
ROWAA (Update Everywhere)
Read -> Read any copy from available sites
Update -> Update any copy from available sites
Modify -> Run a special atomic transaction at all sites: Make sure no concurrent views exist. Make sure sites are of the highest version.
Recovery -> Get missed updates from active nodes.
What does NOTIFY do?
Raises notification event on certain cannel to clients that subscribed. If no session is listening, notifications are lost.
Notification Structure
Channel, Process ID, Payload