Skip to content

Latest commit

 

History

History
112 lines (75 loc) · 4.25 KB

movr.md

File metadata and controls

112 lines (75 loc) · 4.25 KB
title summary toc docs_area
MovR
The MovR application uses CockroachDB to store information about vehicles, users, and rides.
true
develop

MovR is a fictional vehicle-sharing company created to demonstrate CockroachDB's features.

Overview

The MovR example consists of the following:

  • The movr dataset, which contains rows of data that populate tables in the movr database. The movr dataset is built into cockroach demo and cockroach workload.
  • The MovR application, a fully-functional vehicle-sharing application, written in Python. All of MovR application source code is open-source, and available on the movr GitHub repository.

The movr database

{% include {{ page.version.version }}/misc/movr-schema.md %}

Generating schemas and data for MovR

You can use the cockroach demo and cockroach workload commands to load the movr database and dataset into a CockroachDB cluster.

cockroach demo opens a SQL shell to a temporary, in-memory cluster. To open a SQL shell to a demo cluster with the movr database preloaded and set as the current database, use the following command:

{% include_cached copy-clipboard.html %}

$ cockroach demo movr

cockroach workload loads sample datasets and workloads into running clusters. To load the movr database and some sample data into a running cluster, do the following:

  1. Start a secure or insecure local cluster.

  2. Use cockroach workload to load the movr dataset:

    Secure Insecure

    {% include_cached copy-clipboard.html %}

    $ cockroach workload init movr 'postgresql://root@localhost:26257?sslcert=certs%2Fclient.root.crt&sslkey=certs%2Fclient.root.key&sslmode=verify-full&sslrootcert=certs%2Fca.crt'

    {% include_cached copy-clipboard.html %}

    $ cockroach workload init movr 'postgresql://root@localhost:26257?sslmode=disable'
  3. Use cockroach sql to open an interactive SQL shell and set movr as the current database:

    {% include_cached copy-clipboard.html %}

    $ cockroach sql --certs-dir=certs --host=localhost:26257

    {% include_cached copy-clipboard.html %}

    > USE movr;

    {% include_cached copy-clipboard.html %}

    $ cockroach sql --insecure --host=localhost:26257

    {% include_cached copy-clipboard.html %}

    > USE movr;

How the MovR application works

{% include {{ page.version.version }}/misc/movr-workflow.md %}

Extended examples

For a tutorial on running MovR against a multi-region cluster, using two important multi-region data topologies to get very low latency reads and writes, see Low Latency, Multi-Region Deployment.

Develop and deploy a global application

For a tutorial on developing and deploying a globally-available web application for MovR, use the following docs:

  1. MovR: A Global Application Use-case
  2. Create a Multi-region Database Schema
  3. Set up a Virtual Environment for Developing Global Applications
  4. Develop a Global Application
  5. Deploy a Global Application

See also