Skip to main content

Enterprise Application Development with CockroachDB I

A hands-on introduction to running an application backed by a database with serializable isolation.

  • Course Number

    client-side-txn-handling
  • Self-Paced

  • Estimated Effort

    2 hours/week

About This Course

Welcome to Enterprise Application Development with CockroachDB I!

Through this course, you'll delve into the core of transactions, learning about their nature, the significance of ACID properties, and especially focusing on the role of 'isolation'. You'll explore different isolation levels and understand why CockroachDB uses Serializable isolation, the strictest of them all.

We'll unravel the mystery of "retry errors" investigating why they occur in CockroachDB and how they can be effectively managed in your applications. You will not only learn how these errors can maintain the integrity of your transactions but also why they're a better option compared to the alternatives.

This course is an essential stepping stone in your journey as a CockroachDB developer. Whether you're migrating an application or starting fresh, the knowledge you'll gain here will empower you to build high-quality, consistent applications using CockroachDB.

In this course, we'll focus on the questions:

  • How does serializable isolation compare to read committed isolation (a common default for databases like PostgreSQL)?
  • What workflows would be treated differently by serializable isolation vs. read committed?
  • How is serializable isolation enforced at the database level?
  • What does an application working with serializable isolation need?

Examples are in Java.

Suggested prerequisites

It would be helpful to be familiar with the following:

  • At least one programming language (particularly Java).
  • General familiarity with SQL and connecting with a SQL shell.

Detailed course outline

  • Transactions and Isolation Anomalies
    • Lesson - Why transaction handling is important
    • Quiz - Transaction handling
    • Lesson - Not all transactions are ACID: isolation anomalies
    • Exercise - Triggering an isolation anomaly with read committed isolation
    • Exercise - Avoiding an anomaly with serializable isolation
  • Thinking About Contention
    • Lesson - Contention in the database
    • Lesson - Examples of contention
    • Exercise - Triggering a retry error with serializable isolation
    • Quiz - Contention
  • Application Transaction Retry Handling
    • Lesson - Essential properties of transaction retries
    • Exercise - Adding explicit retry logic to the application
    • Exercise - Adding exponential backoff to a retry loop

Course Staff

Will Cross
Will Cross, Ph.D.
Staff Curriculum Developer @ Cockroach Labs

Will is a huge fan of distributed databases and their architectures, and has been with Cockroach Labs for four years. In prior careers, he has been an experimental physicist and a high school teacher.

Frequently Asked Questions

What web browser should I use?

The Open edX platform works best with current versions of Chrome, Edge, Firefox, Internet Explorer, or Safari.

See our list of supported browsers for the most up-to-date information.

Enroll