It's my presentation at Rails Pacific. Knowing the database concept and implementation of Integrity, Locking, Transaction, Index, etc will help developers much better on data modeling design and build solid production applications.
reflected properly in the database, or none are. • Consistency. Execution of the individual transaction should preserve the consistency of the database.
reflected properly in the database, or none are. • Consistency. Execution of the individual transaction should preserve the consistency of the database. • Isolation. Concurrently executing transactions should be isolated from one another, so that each has the impression that no other transaction is executing concurrently with it.
reflected properly in the database, or none are. • Consistency. Execution of the individual transaction should preserve the consistency of the database. • Isolation. Concurrently executing transactions should be isolated from one another, so that each has the impression that no other transaction is executing concurrently with it. • Durability. After a transaction commited, the changes it has made to the database should persist, even if there are system failures.
= User.find(3) user.name = "dingding- #{Time.now.to_i}" user.save end User.transaction(:rea d_committed) do user = User.find(3) puts “1”+user.name sleep 5 user2 = User.find(3) puts “1”+user.name end NO