An electron app to showcase various locality modes of CockroachDB.
- Two locality modes (GLOBAL and REGIONAL BY TABLE) with 3 possible regions table regions (us-east1, us-west1, europe-west1)
- Simulate a client connecting in different regions
- Continuously poll the database for a color value
- Show off SELECT (from the polling) and UPDATE (changing colors) latency
- Support follower reads
- Install CockroachDB
- Run the multi region demo
cockroach demo --global --nodes 9 --no-example-database --insecure
- Edit
src/connections.json
to match your database connection info. To get the database info, you can visit CockroachDB Network Page to figure out which nodes correspond to a region and run\demo ls
on the cockroach console to get the connection strings. - Install project dependencies (only need to run once)
yarn
- Run the electron app
yarn start
Cockroach has a demo mode that can simulate the latency of a multi region cluster.
There are 4 separate tables with different locality modes. It is much faster to switch which table is being queried vs altering the locality of a table.