1

i have a code-related question for cassandra. in dev/qa, we have a 1-node cassandra cluster in stage/prod environments, we have multiple-nodes in a cluster. same cluster NAME, same keyspace name, but different replication factors needed.

how does everybody manage their code-base? an example below is when i need to deploy my scripts to dev/qa, we chose a simplestrategy repl factor. when we need to go to the stage/prod deploy.. we need to now use a NetworkTopologyStrategy with a repl factor = 3.

right now, i'm forced to deploy different scripts, or comment out one line for the other in my scripts:

two versions:

  • create_keyspace_tables.dev.cql
  • create_keyspace_tables.stg.cql

sample script contents in which i have to deal with 2 diff replication factors:

    -- dev/qa
    -- CREATE KEYSPACE IF NOT EXISTS mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
    -- stage/prod
    -- CREATE KEYSPACE IF NOT EXISTS mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
    USE mykeyspace;
    CREATE TABLE my_table (
        storeNumber text,
        businessDate timestamp,
Anthony Mastrean
  • 21,850
  • 21
  • 110
  • 188
lrp_data
  • 11
  • 2
  • update to this: I'm now learning that cassandra / datastax enterprise actually allows me to create a keysapce with NetworkTopologyStrategy, even with a single node. that way, i can keep my keyspace code the SAME instead of having to fork the 'create code' in this manner. can anybody confirm this behaviour at all? – lrp_data Feb 02 '17 at 18:44

0 Answers0