Sample Header Ad - 728x90

Is a multi-table batch within the same node atomic and isolated?

0 votes
1 answer
127 views
Im trying to understand this. cassandra batches are atomic always, and if the batch only modifies a single partition of a single table, then that batch is also isolated. but what about multi table batches partitioned by the same key? assume this tables:
orders (
    order_id pk,
    created_at,
    user_id
)

order_items (
    order_id,
    product_id,
    quantity,
    primary key (order_id, product_id)
)
both tables are partitioned by the same key. if i want to atomically create an order, let say order_id = 123, like this:
begin batch 
  insert into orders ... (123) 
  insert into order_items .... where order_id = 123
  insert into order_items .... where order_id = 123
apply batch
is this batch atomic and isolated ? provided that orders table partition for 123 and order_items table partition for 123 reside in the same node.
Asked by InglouriousBastard (3 rep)
May 10, 2024, 01:24 AM
Last activity: May 10, 2024, 01:47 PM