liveBook · Manning

Record name strategy

As explained in Kafka Streams in Action, Second Edition

RecordNameStrategy is a Schema Registry subject naming strategy that derives a schema subject from the fully qualified record name.

RecordNameStrategy derives each Schema Registry subject from a record’s fully qualified name. This lets one topic carry multiple logically related record types while sharing compatibility rules for each record name. section 3.3.2

The subject, rather than the topic alone, determines where Schema Registry compares schema changes. With this strategy, schemas sharing a record name are checked together across every topic that uses that subject. section 3.3.2 section 3.3

Use RecordNameStrategy when:

  • Different event structures belong on the same topic, such as readings from different IoT sensor types. section 3.3.2
  • The same logical record type should use one compatible schema version across multiple topics. section 3.3.2
  • Avoid it when separate topics must evolve the same record type independently; TopicRecordNameStrategy provides that topic-scoped alternative. section 3.3.2 section 3.3.3

Configure an Avro producer and consumer

Register the schema under its fully qualified record name, then configure both value subject-name settings with RecordNameStrategy. Configure key settings only when keys use schemas; key and value strategies may differ. section 3.3.2

Figure 3.7 RecordNameStrategy enforces having the same schema for a domain object across different topics.
figure

Use the diagram to compare record-name compatibility across topics and understand why one domain record must share its schema version everywhere. section 3.3.2

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Defines subject derivation, cross-topic compatibility, configuration, and tradeoffs but stops short of detailed serializer implementation.
Examples
Uses IoT sensor events and an AvengerAvro record with Gradle, producer, and consumer configuration listings.
What it assumes
Assumes schemas, topics, and Schema Registry usage; distinguishes key and value serialization configuration.
What you can do after
Configure Kafka Avro serializers and deserializers to register and resolve subjects by record name.
How it connects
Connects Schema Registry, schema compatibility, Avro serialization, topics, and TopicRecordNameStrategy.

Also explained in

Compare how 2 books explain record name strategy →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka Streams in Action, Second Edition. The section links point to the parts of the book it draws on.