Table Lock: It locks the entire table. Before a user performs a write operation (insert, delete, update, etc.) on the table, they need to acquire a write lock first, which will block all read and write operations on the table by other users. When there is no write lock, other users can obtain read locks, and read locks between multiple users do not block each other.
Row Lock: Row-level locks can support concurrent processing to the greatest extent (and also bring the largest lock overhead).

ACID

ACID stands for Atomicity, Consistency, Isolation, and Durability.

Atomicity: A transaction must be regarded as a minimal work unit. All operations in the entire transaction are either all committed successfully or all failed and rolled back. For a transaction, it is impossible to execute only a part of the operations.
Consistency: The database always transitions from one consistent state to another consistent state. If the system crashes suddenly when executing a certain statement of the transaction, causing the transaction not to be committed in the end, the modifications made by the transaction will not be saved to the database.
Isolation: Generally speaking, modifications made by a transaction are invisible to other transactions before they are finally committed. When a transaction has not finished execution, modifications to the transaction will not affect external data.
Durability: Once a transaction is committed, its modifications will be permanently saved to the database. At this time, even if the system crashes, the modified data will not be lost.

Isolation Level

READ UNCOMMITTED: Modifications in a transaction, even if not committed, are visible to other transactions. Transactions can read uncommitted data, which is also called Dirty Read. Unless there is a very necessary reason, it is rarely used in practical applications.

READ COMMITTED: When a transaction starts, it can only see modifications made by already committed transactions. Tips: Description serves as an introduction to isolation. This level is sometimes called nonrepeatable read, because executing the same query twice may get different results.

REPEATABLE READ: Solved the problem of dirty reads. This level ensures that the results of reading the same record multiple times in the same transaction are consistent. However, theoretically, the repeatable read isolation level still cannot solve another problem: Phantom Read. Phantom read refers to when a transaction reads records in a certain range, another transaction inserts new records in that range. When the previous transaction reads the records in that range again, phantom rows will be generated. This is the default isolation level of MySQL.
SERIALIZABLE: It is the highest isolation level. It avoids the phantom read problem mentioned above by forcing transactions to execute serially. Simply put, SERIALIZABLE will lock every row of data read, so it may cause a lot of timeouts and lock contention problems. Only consider using this level when it is absolutely necessary to ensure data consistency and no concurrency can be accepted.

Deadlock: Refers to a phenomenon where two or more transactions occupy each other on the same resource and request to lock the resource occupied by the other party, causing a vicious cycle. Deadlocks may occur when multiple transactions try to lock resources in different orders. Deadlocks can also occur when multiple transactions lock the same resource at the same time.

Dual causes of deadlock: Some are due to real data conflicts, and some are completely due to the implementation of the storage engine.