Originally from the User Slack
@Dzung: Hi everyone 
Let’s say I have orders table (order_id as partition key) and denormalized tables with different partition keys (e.g., orders_by_customer_id by customer_id, orders_by_merchant_id by merchant_id).
When I write to all three tables using a logged BATCH:
BEGIN BATCH
INSERT INTO orders (order_id, ...) VALUES (...);
INSERT INTO orders_by_customer_id (customer_id, order_id, ...) VALUES (...);
INSERT INTO orders_by_merchant_id (merchant_id, order_id, ...) VALUES (...);
APPLY BATCH;
Does the logged batch ensure ALL three inserts eventually succeed, or can some succeed while others fail permanently?
From the documentation
ScyllaDB uses a batch log to ensure all operations in a batch eventually complete or none will
However, from other sources like this thread or this thread, logged batch can’t ensure the atomicity across multiple tables and multiple partitions.
BATCH | ScyllaDB Docs
ScyllaDB Community NoSQL Forum: Are BATCH insert/update into different tables logged + “safe”?
ScyllaDB Community NoSQL Forum: Mutli table Batches Atomicity and Isolation
@aviavi**:** The writes are not atomic, but will eventually all get applied.
@Dzung: H@aviy @avi thanks for your reply. So that means the statement from documentation is correct?
ScyllaDB uses a batch log to ensure all operations in a batch eventually complete or none wi@avil
@avi**:** yes
@Dzung:@aviThanks, @avi. One last question: I understand that there’s a performance penalty when using batch atomicity across multiple tables and partitions. In my use case, I only need to insert into two different tables (different partition keys) within the same batch—would the performance impact be sign@avificant?
@avi**:** It’s significant. Batches require extra writes and reads, and destroy the token-aware and shard-aware routing from the driver. But if you need it, then you need it.
@Dzung: if we have 2 tables but sharing the same partition key (orders and order_events both having id_order as the partition key), how would be the performance impact?
My understanding is that a partition is defined by the keyspace, table, and partition key. If that’s correct, then even if two tables use the same partition key value, inserting into two different tables would still involve multiple partitions—is that correct?
@avi**:** yes