Specifying the schema 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 options
Install option Default Note

DataStax installer (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')

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com