Search code examples
cassandracql3

Is there a known limit to the number of CREATE TABLE I can run in parallel with Cassandra?


I'm wondering whether I can have all my clients send a "CREATE TABLE ..." to the same Cassandra cluster at pretty much the same time. Is that expected to work? I can always increase the timeout to make sure that I don't get such an error, but I'm wondering whether this is something that could cause problems, outside of some slowness.

Would it be slower/faster as we increase the number of clients & Cassandra nodes?


Solution

  • Yes, 1. Do not run schema changes in parallel. After each run make sure schema is in agreement before running next (ie java driver: resultset.getExecutionInfo().isSchemaInAgreement())

    They are slow but you should be conservative and patient with them. Its not worth the risk of divergent schemas that can exist with some known race conditions. This may improve in future releases but with all existing versions since the schemas were made dynamic (0.7 - 3.11) this operation should be run one at a time. If your application is dependent on constantly changing and dynamic tables you should re-evaluate your implementation.