Transaction: group of statements guaranteed to either all be done or none be done. Ex. #transfer $1000 from account 1 to account 2: UPDATE bankaccounttable SET balance=balance-1000 WHERE acct_id=1; UPDATE bankaccounttable SET balance=balance+1000 WHERE acct_id=2; Each MySQL statement will not be interrupted by another query or half succeed. It will complete or completely fail on an error (i.e. it is atomic). But, if after the first statement there's a power failure or disk crash or server shutdown and the second statement doesn't complete we have inconsistent data (missing $1000). So the group of two statements must be made to both either complete or neither complete. A transaction is a group of statements that are treated as an atomic unit: either all complete or none does. Either all of the transaction's changes are stored in the database or none of them are stored. Transactions are "atomic". START TRANSACTION; UPDATE bankaccounttable SET balance=balance-1000 WHERE acct_id=1; UPDATE bankaccounttable SET balance=balance+1000 WHERE acct_id=2; COMMIT; By default, to other clients/threads the transaction is not visible until it is committed. No other thread can see the partially completed transaction, e.g. it couldn't see that account 1 is 1000 less and that account 2 is still the same. Transactions are "isolated" from others. Implemented by having multiple versions of the rows that the transactions are using. (Actually, there are several levels of isolation that allow various forms of seeing partially completed transactions...) Transaction can be cancelled with ROLLBACK instead of Commit. START TRANSACTION; UPDATE bankaccounttable SET balance=balance-1000 WHERE acct_id=1; UPDATE bankaccounttable SET balance=balance+1000 WHERE acct_id=2; SELECT balance FROM bankaccounttable WHERE acct_id=1; #and notice #it's negative, so want to quit the transaction: ROLLBACK; #all the changes are undone. It's as if they never happened. Also, if any error occurs (e.g. there is no account 2), the transaction is automatically rolled back. By default, each (non-transaction) statement is automatically committed (it's as if each statement is a transaction by itself). Start Transaction overrides this Autocommit mode. Transactions only work with InnoDB tables. Locks provide some of the benefits of transactions. Read (shared) lock: all threads can read it but none can write it. Write (exclusive) lock: locker has exclusive access (others have no access to it). MyISAM: lock the table. InnoDB: lock the row MyISAM explicit (table) locking: LOCK TABLES t1 WRITE, t2 READ; MyISAM automatic read lock when Selecting from table, automatic write lock when updating table InnoDB explicit (row) locking: