An ordering guarantee preserves records in arrival order within a partition. It does not establish one sequence across partitions, so parallelism can change what a consumer observes globally. section 6.1.1
Use these conditions when record order matters:
- Send related records from the same producer to the same partition; records from different producers or partitions have no guaranteed relative order. section 6.1.1
- Enable idempotence so retries and failures do not disrupt ordering through duplicate or confused producer sequences. section 6.1.1
- Assign each partition to only one instance within a consumer group when scaling a service while retaining its order guarantees. section 4.2.2
- Do not equate partition order with ascending timestamps: CreateTime, LogAppendTime, event time, and stream time answer different questions. section 12.5.1
Scaling product-price processing
A product-price topic can distribute partitions across instances in one consumer group. Each instance processes its assigned partition in order, while separate groups independently read the same data. A second producer or a different partition does not preserve a shared sequence. section 4.2.2
Table 12.3 Streaming times
| Time |
Responsibility |
Meaning |
| Event time |
Our code |
The time at which an event occurred |
| Create time |
Producer |
The time at which the message was created by the producer |
| Log append time |
Broker |
The time at which the message was written to the log by the broker |
| Stream time |
Stream processor |
The time at which a message is processed |
Compare event, producer-creation, broker-append, and stream-processing times before designing time-window operations around ordering. section 12.5.1
