Specifying the schema mode 

How to specify the operational mode.

Two schema modes can be set to control the access to schema changes, Development and Production. In Production mode, all properties for vertex and edge labels must be specified upfront, before data is loaded. In Development mode, data can be loaded without explicit schema definition. The difference in schema modes is for the protection of data in a production environment, but flexibility in a development environment. Also, full scans are allowed in Development mode, while queries must be more targeted in Production mode. An example of a full scan is the query to count all vertices g.V().count(). See schema configuration for more information.

The default schema mode is Production, the stricter mode. If DSE is installed using an installer, this default schema mode may be different, depending on the option selected when installing. A complete rundown of defaults is:
Install option Default Note
bitrock installer Production User can change on installation to Development. Installer writes to dse.yaml.
packages (DEB, YUM) Production Set in dse.yaml.
tarball Production Set in dse.yaml.
sandbox Development  

The schema mode is set in the dse.yaml file for cluster-wide settings, but use a Schema API call to set the schema mode for a single graph. A graph must be currently aliased to a particular graph to run the following commands. If a change is desired cluster-wide, then the dse.yaml file must be changed on each node in the cluster and each node must be restarted.

Procedure

  • Discover the current schema mode.
    gremlin> schema.config().option('graph.schema_mode').get()
    ==>Development
  • Change the schema to Production.
    gremlin>  schema.config().option('graph.schema_mode').set('Production')