Integrate Quine and Astra DB Serverless

query_builder 15 min

Quine uses a graph to represent both your data model and computational model.

With the Quine Cassandra Persistor, you can visualize and explore data in your Astra DB Serverless databases.

Prerequisites

  • Familiarity with Quine

  • JDK 11 or later

Prepare Astra

  1. Create an Astra DB Serverless database or use an existing one.

  2. Generate an application token with the Database Administrator role.

  3. Download your database’s Secure Connect Bundle (SCB).

    For multi-region databases, download the SCB for the region closest to where you plan to run Quine.

  4. Create a keyspace named quine in your database.

Configure Quine

The following steps set up a new Quine project with the Cassandra persistor. Modify them as needed if you want to add the Cassandra persistor to an existing Quine project.

  1. Download the Quine JAR file.

  2. Create a quine directory, and then copy the JAR file to that directory. For example:

    mkdir ~/local/quine
    cp ~/Downloads/quine-VERSION.jar ~/local/quine
  3. In the quine directory, create a quine.conf file:

    cd ~/local/quine
    touch quine.conf
  4. Edit the quine.conf file to use the Cassandra persistor and connect to your Astra database. For more information, see Astra DB configuration for the Cassandra persistor.

    quine.conf
    quine.store {
      # store data in an Apache Cassandra instance
      type = cassandra
    
      # the keyspace to use
      keyspace = quine
      should-create-keyspace = false
      should-create-tables = true
      replication-factor = 3
    
      write-consistency = LOCAL_QUORUM
      read-consistency = LOCAL_QUORUM
    
      local-datacenter = "REGION"
    
      write-timeout = "10s"
      read-timeout = "10s"
    }
    # An earlier version of the Java driver is used here.
    # Check the Quine documentation for dependency updates.
    datastax-java-driver {
      advanced {
        auth-provider {
          class = PlainTextAuthProvider
          username = "token"
          password = "APPLICATION_TOKEN"
        }
      }
      basic {
        cloud {
          secure-connect-bundle = "PATH/TO/SCB.zip"
        }
      }
    }

    Replace the following:

    • REGION: The region where your database is located, such as us-east1. For multi-region databases, use the same region as the SCB.

    • APPLICATION_TOKEN: A secure reference to your database’s application token (prefixed by AstraCS:).

    • PATH/TO/SCB.zip: The path to your database’s SCB zip file.

Quine recommends automatic table creation for development and testing only.

Run Quine

  1. Run Quine with quine.conf:

    java -Dconfig.file=quine.conf -jar quine-VERSION.jar
  2. Wait for the Quine app web server available message before proceeding.

    A warning about valid table options is expected, and you can ignore it.

    2022-06-15 15:11:52,666 WARN [NotFromActor] [s0-io-4] com.datastax.oss.driver.internal.core.cql.CqlRequestHandler - Query '[0 values] CREATE TABLE IF NOT EXISTS journals (quine_id blob,timestamp bigint,data blob,PRIMARY KEY(quine_id,timestamp)) WITH CLUSTERING ORDER BY (timestamp ASC) AND compaction={'class':'TimeWindowCompactionStrategy'}' generated server side warning(s): Ignoring provided values [compaction] as they are not supported for Table Properties (ignored values are: [additional_write_policy, bloom_filter_fp_chance, caching, cdc, compaction, compression, crc_check_chance, dclocal_read_repair_chance, extensions, gc_grace_seconds, id, max_index_interval, memtable_flush_period_in_ms, min_index_interval, nodesync, read_repair, read_repair_chance, speculative_retry])
    Graph is ready!
    Application state loaded.
    Quine app web server available at http://localhost:8080
  3. To use Quine’s visual graph explorer, open a web browser, and then navigate to your Quine app web server’s address. From here, you can create or traverse data with Gremlin or Cypher. You can navigate to the Quine API specification locally at QUINE_WEB_SERVER/docs.

Optional: Load sample data

Use these steps if you want to test some sample data with your Quine integration:

  1. In a separate terminal, run the following command to gracefully shut down Quine:

    curl -X "POST" "http://localhost:8080/api/v1/admin/shutdown"
  2. Download attempts.json from the Quine Password Spraying Detection tutorial.

  3. Store the sample data file in the root of your quine directory alongside your Quine JAR file.

  4. Start Quine with your quine.conf and the sample data:

    java -Dconfig.file=quine.conf -jar quine-VERSION.jar -r passwordspraying
  5. Wait while Quine starts and loads the data. Wait for output such as the following:

    INGEST-1 status is completed and ingested 55000
  6. Navigate to your Quine web server to explore the data.

Troubleshoot the Quine integration

If the Quine server doesn’t start, and the driver returns a clustering key error, do the following:

  1. Use the cqlsh to check that the snapshots table exists:

    cqlsh> use quine;
    
    cqlsh> desc quine;
  2. If the snapshots table doesn’t exist, run the following CQL statement to create it:

    CREATE TABLE quine.snapshots (
        quine_id blob,
        timestamp bigint,
        multipart_index int,
        data blob,
        multipart_count int,
        PRIMARY KEY (quine_id, timestamp, multipart_index)
    ) WITH CLUSTERING ORDER BY (timestamp DESC, multipart_index ASC)
        AND additional_write_policy = '99PERCENTILE'
        AND bloom_filter_fp_chance = 0.01
        AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
        AND comment = ''
        AND compaction = {'class': 'org.apache.cassandra.db.compaction.UnifiedCompactionStrategy'}
        AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
        AND crc_check_chance = 1.0
        AND default_time_to_live = 0
        AND gc_grace_seconds = 864000
        AND max_index_interval = 2048
        AND memtable_flush_period_in_ms = 0
        AND min_index_interval = 128
        AND read_repair = 'BLOCKING'
        AND speculative_retry = '99PERCENTILE';

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax, an IBM Company | Privacy policy | Terms of use | Manage Privacy Choices

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