Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with CockroachDB

You're reading from   Getting Started with CockroachDB A guide to using a modern, cloud-native, and distributed SQL database for your data-intensive apps

Arrow left icon
Product type Paperback
Published in Mar 2022
Publisher Packt
ISBN-13 9781800560659
Length 246 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Kishen Das Kondabagilu Rajanna Kishen Das Kondabagilu Rajanna
Author Profile Icon Kishen Das Kondabagilu Rajanna
Kishen Das Kondabagilu Rajanna
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Getting to Know CockroachDB
2. Chapter 1: CockroachDB – A Brief Introduction FREE CHAPTER 3. Chapter 2: How Does CockroachDB Work Internally? 4. Section 2: Exploring the Important Features of CockroachDB
5. Chapter 3: Atomicity, Consistency, Isolation, and Durability (ACID) 6. Chapter 4: Geo-Partitioning 7. Chapter 5: Fault Tolerance and Auto-Rebalancing 8. Chapter 6: How Indexes Work in CockroachDB 9. Section 3: Working with CockroachDB
10. Chapter 7: Schema Creation and Management 11. Chapter 8: Exploring the Admin User Interface 12. Chapter 9: An Overview Of Security Aspects 13. Chapter 10: Troubleshooting Issues 14. Chapter 11: Performance Benchmarking and Migration 15. Other Books You May Enjoy Appendix: Bibliography and Additional Resources

Managing a transactional key-value store

A transactional layer involves implementing a concurrency control protocol, as multiple transactions can try to update the same data at the same time, which can result in a conflict. In concurrency control, there are two different ways of dealing with conflicts, as outlined here:

  • Avoid conflicts altogether with pessimistic locking—for example, a read/write lock.
  • Let the conflict happen but detect it with optimistic locking and resolve it—for example, multi-version concurrency control (MVCC).

CockroachDB uses MVCC. In MVCC, there can be multiple versions of the same record, but you resolve the conflicts before committing the changes.

In CockroachDB, a given transaction is executed in three phases, outlined next:

  1. A transaction is started with a target range that will participate in the transaction. A new transaction record is created to track the status of the transaction. It will have the initial...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image