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,