3 ms·
> the partition key is the primary key(s) to ensure no out of order writes. Can you get out of order writes if the pk for a row changes?
by bpicolo 3y ago
> the partition key is the primary key(s) to ensure no out of order writes.
Can you get out of order writes if the pk for a row changes?
- tang8330 3y agoGreat question! Say this happened: * CREATE TABLE user_test (id int primary key, name text); * INSERT INTO user_test (id, name) VALUES (1, 'foo'); * UPDATE user_test set id = 2 where id = 1; When the UPDATE call is invoked, there will be 2 events emitted to Kafka. 1/ A DELETE event for id = 1 2/ A CREATE event for id = 2 Here's the detailed events that get emitted: https://gist.github.com/Tang8330/7a9450f95fbae486a4393abdd4990d7e https://gist.github.com/Tang8330/7a9450f95fbae486a4393abdd49...