TopicNameStrategy is Schema Registry’s default subject naming strategy. It derives separate subjects from the Kafka topic name: <topic>-key for keys and <topic>-value for values. section 3.3.1
Because the subject is scoped to a topic, each topic supports one data type per key or value subject. This fits topics named for the event type they contain. section 3.3.1
Use the strategy when:
- Keep one record type on a topic and let Schema Registry enforce compatible changes within that topic. section 3.3.1 section 3.3
- Reuse the same record type on different topics while allowing each topic to register a different schema. section 3.3.1
- Choose another strategy when closely related event types must share one topic without a fixed single type. section 3.3.1
Subjects for an inventory topic
For a topic named inventory-events, register the value schema under inventory-events-value and a key schema under inventory-events-key. No additional strategy configuration is required because TopicNameStrategy is the default. To place PlaneEvent, TruckEvent, and DeliveryEvent together while retaining an allowed set of types, use an Avro union registered under the topic’s value subject with schema references. section 3.3.1 section 3.6
Figure 3.6 TopicNameStrategy enforces having the same type of domain object represented by the registered schema for the value and or the key.
Use the figure to compare how topic-scoped subjects constrain the domain-object type represented by a key or value schema. section 3.3.1

