Kafka orders records only inside a partition
A partition key should follow the aggregate whose order matters, such as account_id. More partitions increase parallelism but cannot provide one total order. A versioned message contract needs event id, schema version, aggregate id, occurred time and enough data for deterministic handling.
Offset progress and business progress differ
Committing an offset before the database effect can lose work; committing after can replay work. A consumer therefore makes the business change idempotent, commonly by storing event-id inbox evidence in the same local transaction as the effect, and advances offsets only after that transaction succeeds.