// Module included in the following assemblies:
//
// assembly-using-the-topic-operator.adoc

[id='ref-operator-topic-{context}']
= Topic management modes

[role="_abstract"]
The `KafkaTopic` resource is responsible for managing a single topic within a Kafka cluster. The Topic Operator provides two modes for managing `KafkaTopic` resources and Kafka topics:

Bidirectional mode:: Bidirectional mode requires ZooKeeper for cluster management. It is not compatible with using Strimzi in KRaft mode.

(Preview) Unidirectional mode:: Unidirectional mode does not require ZooKeeper for cluster management. It is compatible with using Strimzi in KRaft mode.

NOTE: Unidirectional topic management is available as a preview. 
Unidirectional topic management is not enabled by default, so you must xref:ref-operator-unidirectional-topic-operator-feature-gate-{context}[enable the `UnidirectionalTopicOperator` feature gate] to be able to use it.

== Bidirectional topic management

In bidirectional mode, the Topic Operator operates as follows: 

* When a `KafkaTopic` is created, deleted, or changed, the Topic Operator performs the corresponding operation on the Kafka topic.
* Similarly, when a topic is created, deleted, or changed within the Kafka cluster, the Topic Operator performs the corresponding operation on the `KafkaTopic` resource.

TIP: Try to stick to one method of managing topics, either through the `KafkaTopic` resources or directly in Kafka.
Avoid routinely switching between both methods for a given topic.

== (Preview) Unidirectional topic management

In unidirectional mode, the Topic Operator operates as follows: 

* When a `KafkaTopic` is created, deleted, or changed, the Topic Operator performs the corresponding operation on the Kafka topic.

If a topic is created, deleted, or modified directly within the Kafka cluster, without the presence of a corresponding `KafkaTopic` resource, the Topic Operator does not manage that topic.
The Topic Operator will only manage Kafka topics associated with `KafkaTopic` resources and does not interfere with topics managed independently within the Kafka cluster.
If a `KafkaTopic` does exist for a Kafka topic, any configuration changes made outside the resource are reverted. 