Real transactions are serializable
Most databases offer a choice of several transaction isolation levels, offering a tradeoff between correctness and performance. However, that performance comes at a price, as developers must study their transactional interactions carefully or risk introducing subtle bugs. CockroachDB provides strong (“SERIALIZABLE
”) isolation by default to ensure that your application always sees the data it expects. In this post I’ll explain what this means and how insufficient isolation impacts real-world applications.
大多数数据库提供多种事务隔离级别的选择,在正确性和性能之间进行权衡。 然而,这种性能是有代价的,因为开发人员必须仔细研究他们的事务交互,否则就有引入微妙错误的风险。 CockroachDB 默认提供强(“可串行化”)隔离,以确保您的应用程序始终看到它期望的数据。 在这篇文章中,我将解释这意味着什么以及隔离不足如何影响实际应用程序。