Question

How do you deal with a schema change in Cassandra ? Say i have

table users (u_uuid, first name)

and

table videos(v_uuid, name)

as well as

table users_videos (uuid, u_uuid, first name, v_uuid, name)

. After 6 months i decide to change the schema with new data that i have about my users' 'Last name'. How do i update all of my tables (users and users_videos) to add the last name data, after i 've done an ALTER? How to load the data in each and everyone of the tables with consistency ? In other words how do you deal with massive updates given that you cannot join the data ?

thanks, Matt

Était-ce utile?

La solution

With CQL, you can use BATCH statement to execute multiple updates / inserts atomically:

BEGIN BATCH
  UPDATE...
  UPDATE...
  UPDATE...
  ...
APPLY BATCH

In case you are trying to manipulate a large amount of rows once, you may want to look at Cassandra bulk loader.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top