Skip to content

Comment on Launch HN: Artie (YC S23) – Real time data replication to data warehouses

Comments

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?

Great 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/7a9450f95fbae486a4393abdd49...

Interesting! I'm both surprised and also not surprised it's modeled that way.

Eventual consistency FTW!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.