Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Dumping/Loading Schema in Cassandra

DZone's Guide to

Dumping/Loading Schema in Cassandra

· Database Zone ·
Free Resource

Read the 2019 State of Database DevOps Report for the very latest insights

This handy command line will dump a schema from Cassandra:

echo -e "use your_keyspace;\r\n show schema;\n" | bin/cassandra-cli -h localhost > mySchema.cdl

I always forget the "-e" on echo, which is why I thought I would blog this.  We've started using ".cdl" as the extension, short for "Cassandra DDL".


Coincidentally, you can then load it with:

bin/cassandra-cli -h localhost -f mySchema.cdl

Hope people find this useful.

Read the 2019 State of Database DevOps Report for latest insights into DevOps adoption among SQL Server professionals, and the benefits and challenges of including the database in DevOps initiatives

Topics:
architects ,nosql ,tips and tricks ,cassandra

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}