谈谈PhxSQL的设计和实现哲学(下)
|
如果是read repeatable级别隔离,sub_a和sub_b都会同时成功!最后A和B账户的透支额分别是A=1000+400=1400,B=500+300=800,总的透支额A+B=1400+800=2200>2000,超过了银行授予的额度!如果不是信用卡的两笔小消费,而是两笔大额转账,那么银行怎么办? 如果是serializable级别隔离,则sub_a和sub_b只有一个成功.具体分析有兴趣的读者可以自己完成. 7.4. 为什么不把显著提升MySQL性能作为一个主要目标? 事实上,PhxSQL已经显著提升了MySQL主备的写入性能.与semi-sync比,在测试环境中,PhxSQL的写入性能比semi-sync高15%到20%以上.读性能持平.这是在满足完全兼容MySQL和最小侵入MySQL原则下所能获得的结果.鉴于PhxSQL对MySQL的改动是如此之小,对性能有高要求的读者,可以方便地把PhxSQL中的MySQL换成其它高性能版本,获得更高性能. 7.5. 为什么编译时不支持C++11以下标准? 作为热爱新技术的码农,我们真的很喜欢C++11中期待已久、激动人心的新特性,例如极大增强的模板、lambda表达式、右值和move表达式、多线程内存模型等,这将C++带入了一个新的时代,大大提高了码农搬砖的速度、编码的正确性、和程序的性能.有了C++11,PhxSQL的开发效率提高了很多. 8. 与Galera及MySQL Group replication的比较 参见7.1.2小节. 结论 PhxSQL是一个完全兼容MySQL,提供与Zookeeper相同强一致性和可用性的MySQL集群. 感谢大家看完这么长的一篇文章.希望大家多阅读PhxSQL源码,多提技术性意见,甚至成为源码贡献者! 参考 1. M.P. Herlihy and J. M. Wing. Linearizability: a correctness condition for concurrent objects. ACM Transactions on Programming Languages and Systems (TOPLAS),Volume 12 Issue 3,July 1990,Pages 463-492. 2. L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Computer. C-28,9 (Sept. 1979),690-691. 3. P. Hunt,M. Konar,F. P. Junqueira,and B. Reed. ZooKeeper: wait-free coordination for Internet-scale systems. USENIXATC’10,2010. 4. L. Lamport. Paxos Made Simple. ACM SIGACT News (Distributed Computing Column) 32,4 (Whole Number 121,December 2001) 51-58. 5. D. Ongaro and J. Ousterhout. In search of an understandable consensus algorithm. USENIX ATC ’14,2014. 6. B. M. Oki and B.H. Liskov. Viewstamped replication: a New primary copy method to support highly-available distributed systems. PODC’88,8-17,1988. 7. T. Chandra,R. Griesemer,and J. Redstone. Paxos made live – an engineering perspective. PODC’07,2007. 8. J. C. Corbett,J. Dean,M. Epstein,and etc. Spanner: Google’s Globally-Distributed Database. OSDI’12,2012. 9. F. Pedone,R. Guerraoui,and A. Schiper. The database state machine approach. Journal of Distributed and Parallel Databases and Technology,14:71–98,2002 10. V. Zuikeviciute and F. Pedone. Revisiting the database state machine approach. VLDB Workshop on Design,Implementation,and Deployment of Database Replication. 2005. 11. http://galeracluster.com/documentation-webpages/certificationbasedreplication.html. Visited at 2016/9/5. 12. https://en.wikipedia.org/wiki/Snapshot_isolation. Visited at 2016/9/5. 13. Y. Amir,L. E. Moser,P. M. Melliar-smith,D. A. Agarwal,and P. Ciarfella. The totem single ring ordering and membership protocol. ACM Transactions on Computer Systems. 13 (4): 311–342. 14. http://downloads.mysql.com/presentations/innovation-day-2016/Session_7_MySQL_Group_Replication_for_High_Availability.pdf. Visited at 2016/9/5. 15. http://galeracluster.com/documentation-webpages/architecture.html. Visited at 2016/9/5. 16. http://corosync.github.io/corosync/. Visited at 2016/9/5. 17. http://www.spread.org/. Visited at 2016/9/5. 18. http://galeracluster.com/documentation-webpages/isolationlevels.html. Visited at 2016/9/5 19. L. Lamport. Fast Paxos. Technical Report,MSR-TR-2005-112. 20. I. Moraru,D. G. Andersen,and M. Kaminsky. There is more consensus in egalitarian parliaments. SOSP’13,2013. 21. https://github.com/tencent-wechat/phxpaxos. 22. http://mp.weixin.qq.com/s?__biz=MzI4NDMyNTU2Mw==&mid=2247483783&idx=1&sn=a2d6e589f1f591ded7703eb74aefccbe. Visited at 2016/9/5. 文:mingchen 文章出处:微信后台团队
(编辑:网站开发网_盐城站长网 ) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |

