Cube can be configured in two ways. The first is through options in a configuration file, commonly known as the cube.js file, and secondly, through environment variables. Values specified in cube.js will take precedence over environment variables.

When using Docker, ensure that the cube.js configuration file and your model/ folder are mounted to /cube/conf within the Docker container.

Cube Cloud

You can set environment variables in Settings → Configuration:

Cube Cloud Environment Variables Screen

Development Mode

Cube can be run in an insecure, development mode by setting the CUBEJS_DEV_MODE environment variable to true. Putting Cube in development mode does the following:

  • Disables authentication checks
  • Enables Cube Store in single instance mode
  • Enables background refresh for in-memory cache and scheduled pre-aggregations
  • Allows another log level to be set (trace)
  • Enables Developer Playground on http://localhost:4000
  • Uses memory instead of cubestore as the default cache/queue engine
  • Logs incorrect/invalid configuration for externalRefresh /waitForRenew instead of throwing errors
  • Allows access to non-public cubes and members through the /meta endpoint and for querying through the REST, GraphQL or SQL APIs.

Concurrency and pooling

All Cube database drivers come with presets for concurrency and pooling that work out-of-the-box. The following information is included as a reference.

For increased performance, Cube uses multiple concurrent connections to configured data sources. The CUBEJS_CONCURRENCY environment variable controls concurrency settings for query queues and the refresh scheduler as well as the maximum concurrent connections. For databases that support connection pooling, the maximum number of concurrent connections to the database can also be set by using the CUBEJS_DB_MAX_POOL environment variable; if changing this from the default, you must ensure that the new value is greater than the number of concurrent connections used by Cube's query queues and refresh scheduler.