Skip to main content

Create Apache Kafka® topics

Create topics in your Aiven for Apache Kafka® service to organize message streams between producers and consumers.

Understand Kafka topics

A topic in Aiven for Apache Kafka is a named stream of messages. Producers write data to topics, and consumers read from them.

Topic types depend on your Kafka service type.

Topic types

  • Classic topics

    • They are available in Classic Kafka and Inkless Kafka services.
    • Storage behavior varies by service type:
      • In Classic Kafka services, data is stored on local broker disks unless tiered storage is enabled.
      • In Inkless Kafka services, classic topics use remote storage by default. You cannot change the storage mode or local retention settings.
  • Diskless topics

    • They are available only in Inkless Kafka services.
    • They store topic data directly in cloud object storage.
    • They require diskless support to be enabled on the service before you create diskless topics.
    • You choose classic or diskless per topic when you create the topic.
    • You cannot change the topic type after creation.

In Inkless Kafka services, classic and diskless topics can coexist. To choose between them, see Compare diskless and classic topics.

For diskless topic limitations, see Limitations of diskless topics.

Before you begin

Before you create topics in your Aiven for Apache Kafka service, review the following:

  • Tiered storage is available in Classic Kafka services, where you can enable and configure it per topic. See Tiered storage.
  • Manual topic creation gives you control over partitions, replication, and retention. This approach is preferred in production to prevent accidental topic creation.
  • Automatic topic creation is disabled by default. Enable it only when needed (for example, for development clusters). In production, leave it disabled to govern topic creation and avoid accidental topics. On Inkless Kafka, auto-created topics are classic topics. Create diskless topics manually. For more information, see Create topics automatically.

Create an Apache Kafka topic

The topic creation options shown in the Aiven Console depend on the Kafka service type. In Classic Kafka services, you create classic topics. Inkless Kafka services let you choose between classic and diskless topics.

Kafka CLI and client APIs on Inkless Kafka
  • When you create a topic with the Kafka CLI (kafka-topics.sh), the Kafka Admin API, or other Kafka clients without specifying a topic type, the topic is created as a classic topic with remote storage by default.
  • To create a diskless topic, use the Aiven Console or Aiven CLI and explicitly select the diskless topic type. If you use kafka-topics.sh for diskless topics, use the script from the Inkless repository.
  1. In the Aiven Console, select the Aiven for Apache Kafka service.

  2. In the sidebar, click Topics.

  3. Click Create topic.

  4. Enter a name in the Topic field.

  5. Optional: Turn on Enable advanced configurations to set values such as replication, partitions, retention, and cleanup policy.

  6. Optional: Click Add configuration to add other Kafka topic parameters.

  7. Optional: Under Tiered storage, enable tiered storage for the topic.

    note

    You cannot disable tiered storage after you enable it.

  8. Click Create topic.

After creation, the topic appears on the Topics page. The Topic type column shows Classic or Diskless.

Related pages