# Is a KTable a viable solution for separating interleaved batches

**URL:** <https://forum.confluent.io/t/is-a-ktable-a-viable-solution-for-separating-interleaved-batches/2942>\
**Category:** Kafka Streams\
**Created:** [30 September 2021 11:09 UTC](https://forum.confluent.io/t/is-a-ktable-a-viable-solution-for-separating-interleaved-batches/2942 "2021-09-30T11:09:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grasp](https://avatars.discourse-cdn.com/v4/letter/g/8e7dd6/32.png) [@Grasp](https://forum.confluent.io/u/Grasp)\
**Post date:** [30 September 2021 11:09 UTC](https://forum.confluent.io/t/is-a-ktable-a-viable-solution-for-separating-interleaved-batches/2942/1 "2021-09-30T11:09:30Z")

</div>

We have a kafka application that processes CDC events from Debezium, and cleanses the data (10-200 events across 10+ topics) before assigning a common key to all records from the same transaction and pushing the events (using multiple schemas) to a single partitioned topic. Another application needs to process all events by transaction. The end result is that each partition can have a stream of events from interleaved transactions, so once-only processing becomes complex if the application attempts to manage the offsets itself.  
Would a viable solution be to convert to a KTable grouping by transaction and returning an array of Avro GenericRecords be a viable solution? Given that there will be billions of records during initial load, will this be performant? Source events are created in kafka transactions so if read-committed is enabled, events for transactions should not appear until a commit is received.  
Can anyone describe a better “black box” solution that does not require manually coding an offset tracker?
