Perf supports using CockroachDB as a backend.

There should be a cockroachdb/connect-* script for each instance in this directory. Run that script and you will be dropped into an SQL shell as root to send commands to the server. You can, for example, create a new database here:

    CREATE DATABASE androidx;

See also:

You can get to the admin interface for each by running the associated cockroachdb/admin-* script, which will set up a port-forward to the admin interface and launch chrome to load the interface.


Follow the instructions on how to set up an instance of CockroachDB on a single kubernetes cluster.

But after downloading the statefulset yaml:

curl -O

The file should be renamed to reflect the Perf instance that will use it, and the names and app labels in the file should be rename to also reflect the Perf instance, for example:


The service name and user account are then used in the connection string in the config file, for example:

  "data_store_config": {
  "datastore_type": "cockroachdb",
  "connection_string": "postgresql://root@perf-androidx-cockroachdb-public:26257/androidx?sslmode=disable",

See also configs


In theory the migrations library will take care of schema migrations on startup, but in reality, if running more than one instance, contention for the lock can arise. The migrations can be applied from the desktop by using the migrations command line app, which can be installed by:

go get -tags 'cockroachdb'

Now port-forwarding the database port for the cockroachdb instance, for example:

kubectl port-forward perf-skia-cockroachdb-0 26257

Then run the migrations:

migrate -verbose -path ./migrations/cockroachdb/ -database cockroachdb://root@localhost:26257/skia?sslmode=disable up