A topic is a named logical channel or category to which producers publish messages and from which consumers subscribe in a publish-subscribe messaging system. It acts as a durable, append-only log, decoupling the sender from the receiver so that multiple downstream applications can independently process the same real-time data stream without direct point-to-point connections.
Glossary
Topic

What is a Topic?
A topic is a fundamental logical channel in a publish-subscribe system that decouples message producers from consumers, enabling scalable, asynchronous data distribution.
In systems like Apache Kafka, a topic is further divided into partitions for parallel consumption, with each record assigned a unique, sequential offset. This architecture provides high-throughput, fault-tolerant data distribution, where consumer groups manage load balancing and log compaction or retention policies control the lifecycle of the stored messages.
Key Characteristics of a Topic
A topic is the fundamental addressing mechanism in publish-subscribe messaging systems, acting as a logical channel that decouples producers from consumers and enables scalable, asynchronous communication.
Logical Partitioning for Parallelism
A topic is divided into partitions, which are ordered, immutable sequences of records. Each partition is a unit of parallelism—multiple consumers can read from different partitions simultaneously, enabling horizontal scalability. Partitions are distributed across brokers in a cluster, and the number of partitions determines the maximum parallelism of consumption. Messages within a partition maintain strict total order, but ordering across partitions is not guaranteed.
Durable, Immutable Append-Only Log
A topic is implemented as an append-only commit log stored on disk. Once a message is written, it is immutable—it cannot be altered or deleted by normal operations. This design provides durability and enables features like replayability and auditability. Retention policies control how long messages persist, configurable by time (e.g., 7 days) or size (e.g., 1 TB). Log compaction is a specialized retention strategy that retains only the latest value per key, useful for maintaining current state.
Publish-Subscribe Decoupling
Producers publish messages to a topic without knowledge of the consumers. Subscribers express interest by subscribing to the topic and consume messages at their own pace. This temporal decoupling means producers and consumers do not need to be online simultaneously. Spatial decoupling means they do not need to know each other's network addresses. This loose coupling is foundational to event-driven architectures and microservices communication.
Consumer Groups and Offset Tracking
Consumers are organized into consumer groups for load-balanced consumption. Each partition is consumed by exactly one member within a group, enabling parallel processing. Consumers track their position using an offset—a unique sequential ID per record. Offsets are committed periodically, allowing consumers to resume from their last committed position after failure. This model supports at-least-once or exactly-once delivery semantics depending on configuration.
Schema Enforcement and Governance
Messages in a topic are typically serialized with a schema-based format like Apache Avro or Protobuf. A Schema Registry stores and validates schemas, enforcing compatibility rules (backward, forward, full) as topics evolve. This prevents data corruption and ensures that producers and consumers agree on the structure of messages. Schema evolution is critical for maintaining data contracts in long-lived streaming pipelines.
Replication and Fault Tolerance
Each partition is replicated across multiple brokers for high availability. One broker acts as the leader for a partition, handling all reads and writes, while followers passively replicate the data. If the leader fails, a follower is automatically elected as the new leader. The replication factor (typically 3) determines the number of copies, balancing durability against storage cost. This design ensures zero data loss in the face of hardware failures.
Frequently Asked Questions
Clear, technical answers to common questions about publish-subscribe messaging, topic architecture, and real-time data routing in event-driven systems.
A Topic is a logical channel or category to which producers publish messages and from which consumers subscribe to receive them. In systems like Apache Kafka and Apache Pulsar, a topic is the core abstraction for organizing and durably storing streams of events. Each topic is identified by a unique name and acts as a partitioned, append-only log. Producers write records to a topic, and the messaging system ensures those records are delivered to all interested consumer groups. Topics decouple producers from consumers, allowing services to communicate asynchronously without direct dependencies. For example, an e-commerce platform might use a user-clicks topic to stream clickstream data, a checkout-events topic for purchase completions, and an inventory-updates topic for stock level changes, each consumed by different downstream services independently.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core concepts that form the foundation of event-driven data pipelines and real-time stream processing.
Stream Processor
A computation engine that continuously processes unbounded streams of data records to perform operations like filtering, aggregation, and joining in real-time. Unlike batch processing, stream processors handle data as it arrives.
- Examples include Apache Flink, Kafka Streams, and Spark Streaming
- Supports stateful operations using embedded state stores
- Uses windowing to divide infinite streams into finite chunks for analysis
Exactly-Once Semantics
A delivery guarantee ensuring that a message is processed only once, even in the face of network failures or producer retries. This prevents both data duplication and data loss in critical pipelines.
- Achieved through idempotent producers and transactional coordination
- Requires cooperation between the messaging system and the stream processor
- Essential for financial transactions and inventory management systems
Change Data Capture (CDC)
A design pattern that identifies and captures row-level changes to a source database and streams them as events to downstream systems in real-time. CDC eliminates the need for batch ETL by turning database commits into event streams.
- Tools like Debezium tail database transaction logs
- Enables real-time cache invalidation and search index updates
- Preserves the full history of mutations for audit and replay
Windowing
A technique that divides an unbounded data stream into finite chunks based on temporal boundaries for performing aggregations like counts, sums, or averages. Windows define the scope of a computation over time.
- Tumbling windows: Fixed-size, non-overlapping intervals
- Sliding windows: Overlapping intervals that slide by a step size
- Session windows: Dynamic windows based on periods of user inactivity

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us