Week 10 L1 Flashcards
What is CAP theorem?
States that a distributed database system can simultaneously guarantee at most two out of three of :
Consistency, availability, and partition tolerance.
What is CAP consistency?
In distributed databases, to maintain consistency, every read gets the most recent data, and every write is durable.
What is eventual consistency?
Eventual consistency allows some nodes to be out of date but hey will catch up quickly.
What is Strict consistency
consistency means that every read, no matter which replica it is made from gives the same answer. This requires writes to propagate fully to every replica node before a read can take place. This is not always necessary!
How do you ensure a user can read their Writes?
Use sticky sessions.
What are sticky sessions?
A session between a user and a node can be maintained so the interaction is consistent, although this will reduce the efficiency of workload balancing.
What do we mean by Read/Write availability?
When writes need to go through a master node by reads can go through slaves, availability depends on the type of request. A read can be available, but a write might be unavailable.
What do we mean by partition tolerance?
Database can be partition tolerant if it allows the loss of either consistency or availability when it is partitioned.
It can keep consistency by making some nodes unavailable.
Or stay available but accept it will be inconsistent.
When there are no partitions, it is possible for database to be both consistent and available but not guaranteed.
What is read/write Quora ?
can reduce the waiting time for updating propagation to replicas by making a trade off between reads and writes.
Write to 3 replicas then read from 1 (pick any)
Write to 2 then read from 2 (pick most recent)
Write to 1 then read from 3 ( pick most recent)