Databases
Concurrency control
Schedules, conflict serializability and locking protocols.
In two minutes
One idea to a line
Two operations conflict if they are from different transactions, touch the same item and at least one is a write.
A schedule is conflict serializable exactly when its precedence graph has no cycle. A topological order is an equivalent serial schedule.
Two-phase locking (a growing phase, then a shrinking phase) guarantees conflict serializability but can deadlock.
Strict 2PL holds exclusive locks until commit, which also avoids cascading rollbacks.
Timestamp ordering gives each transaction a timestamp and rejects operations that arrive too late, so it has no deadlock.
Slips people make here
Interviewers know them too
Drawing edges for two reads.
Saying a serializable schedule must equal the order the transactions started in.
Believing 2PL prevents deadlock.
Your practice here
Not started
10 written questions, and 1 kind of calculation that change every time
No answers yet