Skip to main content
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 and .
  • 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

The six tables in the movr database store user, vehicle, and ride data for MovR:
TableDescription
usersPeople registered for the service.
vehiclesThe pool of vehicles available for the service.
ridesWhen and where users have rented a vehicle.
promo_codesPromotional codes for users.
user_promo_codesPromotional codes in use by users.
vehicle_location_historiesVehicle location history.
Geo-partitioning schema

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. 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 , use the following command:
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 or local cluster.
  2. Use cockroach workload to load the movr dataset:
  3. Use to open an interactive SQL shell and set movr as the :

How the MovR application works

The workflow for MovR is as follows:
  1. A user loads the app and sees the 25 closest vehicles. For example:
  2. The user signs up for the service. For example:
  3. In some cases, the user adds their own vehicle to share. For example:
  4. More often, the user reserves a vehicle and starts a ride, applying a promo code, if available and valid. For example:
  5. During the ride, MovR tracks the location of the vehicle. For example:
  6. The user ends the ride and releases the vehicle. For example:

See also