- Lock-based and timestamp-based protocols are two main approaches for concurrency control in database systems to achieve atomicity, consistency, isolation, and durability (ACID) properties of transactions.
- Lock-based protocols use locking mechanisms to control concurrent access to data and can cause deadlocks between transactions waiting for locks. Timestamp-based protocols assign timestamps to transactions and check for conflicts based on timestamp ordering to guarantee serializability without waits but lack recoverability.
- Deadlocks are addressed through prevention, detection using wait-for graphs, and resolution by rolling back the minimum number of transactions to break cycles while avoiding starvation.