First of all, you really shouldn't have that many keyspaces. Put that aside, the quickest way to create large number of keyspaces without causing schema disagreement is create keyspaces in parallel over a connection pool with a number of connections all against the same single Cassandra node. Because all CREATE KEYPSPACE statements are sent to the same node, you don't need to worry about schema disagreement it may cause, as the server side internally will ensure the consistency of the schema.

On 09/03/2022 18:35, Leon Zaruvinsky wrote:
Hey folks,

A step in our Cassandra restore process is to re-create every keyspace that existed in the backup in a brand new cluster.  Because these creations are sequential, and because we have _a lot_ of keyspaces, this ends up being the slowest part of our restore.  We already have some optimizations in place to speed up schema agreement after each create, but even so we'd like to get the time down significantly more.

I was curious if anyone has any guidance or has experimented with ways of creating keyspaces that are faster than a bunch of CREATE calls.  It's fine for the cluster to be offline during the process.

Thanks,
Leon

Reply via email to