三歪面试被问到MySQL事务,回答惊艳了面试官
Posted Java3y
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了三歪面试被问到MySQL事务,回答惊艳了面试官相关的知识,希望对你有一定的参考价值。
《对线面试官》系列目前也已经连载22篇啦!有深度风趣的系列!



















一不小心就写了这么长了,总结下今天的知识点吧(赞和转发是肯定要的,别想了,又不用钱):
-
事务为了保证数据的最终一致性 -
事务有四大特性,分别是原子性、一致性、隔离性、持久性 -
原子性由undo log保证 -
持久性由redo log 保证 -
隔离性由数据库隔离级别供我们选择,分别有read uncommit,read commit,repeatable read,serializable -
一致性是事务的目的,一致性由应用程序来保证 -
事务并发会存在各种问题,分别有脏读、重复读、幻读问题。上面的不同隔离级别可以解决掉由于并发事务所造成的问题,而隔离级别实际上就是由mysql锁来实现的 -
频繁加锁会导致数据库性能低下,引入了MVCC多版本控制来实现读写不阻塞,提高数据库性能 -
MVCC原理即通过read view 以及undo log来实现
以上是关于三歪面试被问到MySQL事务,回答惊艳了面试官的主要内容,如果未能解决你的问题,请参考以下文章