Spring Boot code samples referenced from the Java Developer Training presentation deck.
- Chapter 1 :: Transactions
- Chapter 2 :: Contention
- Chapter 3 :: Performance
- Chapter 4 :: Patterns
- Common
- Domain
- MacOS
- Linux
- JDK 21+ (LTS)
- CockroachDB v23+
Things you need to build and run the modules locally.
- Java 21+ JDK
- Git
MacOS (using sdkman):
curl -s "https://get.sdkman.io" | bash
sdk list java
sdk install java 21.0 (use TAB to pick edition)
Ubuntu:
sudo apt-get install openjdk-21-jdk
See start a local cluster for setup instructions. You can also use CockroachDB Cloud (basic, standard or advanced).
Then create the database, for an insecure cluster:
cockroach sql --insecure -e "create database training_modules"
alternatively, for a secure cluster:
cockroach sql --certs-dir=certs -e "CREATE DATABASE training_modules; ALTER ROLE root WITH PASSWORD 'cockroach'"
An enterprise license is needed for some of the chapters that use enterprise features like follower reads and CDC.
git clone git@github.com:cockroachlabs-field/training-modules.git && cd training-modules
chmod +x mvnw
./mvnw clean install
Pick the training chapter you want to run the tests in, for example chapter 1.
cd ch1-transactions
Then run the test starter script which will present a menu of options:
./run-test.sh
If you need to connect to a CockroachCloud cluster or non-local cluster, you can edit the
./run-server.sh
file accordingly.
Use of this project is entirely at your own risk and Cockroach Labs makes no guarantees or warranties about its operation.
See MIT for terms and conditions.
That is all, carry on!