Week 12 Part 2 Flashcards
This stores multiple copies of a dataset on multiple nodes
Replication (the copies are called replicas)
What does replication provide?
Scalability and availability
The redundancy achieved through replication leads to _____ tolerance
fault tolerance
What are the 2 methods used to implement replication?
Master-slave
peer-to-peer
Master-slave replication: All data is written to a master node, what happens?
The slave nodes replicate the data
Master-slave replication: Where do write requests like insert, delete, and update occur? Where do read requests occur?
Write requests: Master
read requests: Slave
Is master-slave replication ideal for write intensive loads or read intensive loads? Why?
Read intensive loads. The system can be scaled horizontally by adding more slave nodes.
What happens to the master slave replication system when the amount of writes increases?
The system suffers. There’s only 1 master node.
T/F - If the master node fails, reads are no longer possible
False, can read from any slave node
T/F - A salve node can be configured as a backup for the master node
True
T/F - If the master node fails, writes are no longer possible
True, until a master node is reestablished
T/F - master node is either resurrected from a backup of the master node, or a new
master node is chosen from the slave nodes
True
T/F - In peer to peer, one node writes, the other reads
False
T/F - In P2P each write is copied by all peers
True
Name this ACID principle: ensures that all operations will always succeed or fail
completely (no partial transactions)
Atomicity
Name this ACID principle: ensures that the database will always remain in a consistent
state by ensuring that only data that conforms to the constraints of the
database schema can be written to the database
Consistency
Name this ACID principle: ensures that the results of a transaction are not visible to other
operations until it is complete
Isolation
Name this ACID principle: ensures that the results of an operation are permanent. In other
words, once a transaction has been committed, it cannot be rolled back.
This is irrespective of any system failure
Durability
A user updates 3 records. 2 are successful, the 3rd one fails. The entire system is rolled back before the update. Why?
Atomicity
User tries to update a column with a datatype of float with a varchar value. The DB rejects this update. Why?
Consistency
user A attempts to update 2 records, the DB updates the first one, but User B tries to update the 2nd record at the same time. User B cannot update the 2nd record. Why?
Isolation (must wait until User A’s update succeeds or fails)
A user updates a record, the DB updates it. Right after this there is a power failure but the DB maintains its state. When the power comes back on the record is still there, why?
Durability