Hi Dan, 1) In general, there is no guarantee that your downstream operator is on the same TM although working on the same key group. Nevertheless, you can try force this kind of behaviour to prevent the network transfer by either chaining the two operators (if no shuffle is in between) or configure a slot sharing group[1]. A very naive approach is only using one large TM but this often does not suffice.
2) Unfortunately, I do not fully understand your second question. From a Flink Source perspective reading from Kafka currently does not preserve the Kafka partitioning, meaning that you need to regroup your data again. We currently investigate different solutions to allow mapping a Kafka partition to a Flink key group. I’d need some more information about the writing to Kafka scenario you are describing to give a satisfying answer. Best, Fabian [1] https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/concepts/flink-architecture/#task-slots-and-resources