---
title: "Colocating Input Partitions with Kafka Streams When Consuming Multiple Topics: Sub-Topology Matters!"
url: https://daily.dev/posts/colocating-input-partitions-with-kafka-streams-when-consuming-multiple-topics-sub-topology-matters--xfvpfqrj3
source_url: https://medium.com/expedia-group-tech/colocating-input-partitions-with-kafka-streams-when-consuming-multiple-topics-sub-topology-matters-f92da955c905
type: article
source: "Expedia Group Tech"
published: 2025-11-11T14:49:24.049Z
updated: 2025-11-11T14:49:45.285Z
tags: ["kafka", "distributed-systems"]
reading_time: 4
upvotes: 1
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Colocating Input Partitions with Kafka Streams When Consuming Multiple Topics: Sub-Topology Matters!

**[Expedia Group Tech](https://daily.dev/sources/expedia)** · 4 min read · 1 upvotes · 0 comments

## Summary

Explores a production issue where Kafka Streams failed to colocate matching partitions from two topics on the same instance, breaking cache locality. The root cause was implicit creation of separate sub-topologies for each topic. The solution involved replacing a local Guava cache with a shared Kafka Streams state store, which unified the sub-topologies and enforced partition colocation. This architectural change ensured identical keys from both topics were processed by the same instance, significantly reducing redundant external API calls and improving performance.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/expedia-group-tech/colocating-input-partitions-with-kafka-streams-when-consuming-multiple-topics-sub-topology-matters-f92da955c905>

## Similar posts on daily.dev

- [Scaling Kafka Streams for High-Volume Data Processing](https://daily.dev/posts/scaling-kafka-streams-for-high-volume-data-processing-z92hg4j5s) · Confluent Blog · 1 upvotes · 0 comments
- [Key Concepts of Kafka](https://daily.dev/posts/key-concepts-of-kafka-eokkrpzio) · System Design Codex · 25 upvotes · 0 comments
- [My Experience with Kafka: A Cross-Region Event Bus for Hundreds of Microservices. Part 1](https://daily.dev/posts/my-experience-with-kafka-a-cross-region-event-bus-for-hundreds-of-microservices-part-1-kcbponxxn) · ITNEXT · 8 upvotes · 0 comments

---

Tags: [#kafka](https://daily.dev/tags/kafka), [#distributed-systems](https://daily.dev/tags/distributed-systems)

[View this post on daily.dev](https://daily.dev/posts/colocating-input-partitions-with-kafka-streams-when-consuming-multiple-topics-sub-topology-matters--xfvpfqrj3)
