Confluent Schema Registry Flashcards
What is the purpose of the Schema Registry in the Kafka ecosystem?
The Schema Registry stores and retrieves Avro schemas for producers and consumers, enforces compatibility (backward, forward, or full), and reduces message size since schemas are not sent with the payload.
What is Kafka REST Proxy, and how does it interact with Avro and Kafka?
Kafka REST Proxy allows non-Java clients to interact with Kafka using HTTP requests. It integrates with the Schema Registry for Avro and supports producers and consumers through REST endpoints.
What are the advantages of using Avro?
- Fully typed data.
- Automatic compression.
- Schema travels with the data.
- Embedded schema documentation.
- Language-agnostic data readability.
- Safe schema evolution.
What are the disadvantages of using Avro?
- Limited support for some languages.
- Data cannot be printed directly without using Avro tools, as it’s compressed and serialized.
Name some primitive types supported by Avro.
- null
- boolean
- int
- long
- float
- bytes
- string
What are the common fields in an Avro Record Schema?
- Name
- Namespace
- Doc (optional)
- Aliases (optional)
- Fields: Name, Doc, Type, Default
What is the key rule when using Enums in Avro?
Once set, enum values cannot be changed to maintain compatibility.
How does Avro define arrays?
As a list of items of the same schema, e.g., {“type”: “array”, “items”: “string”}.
What is a map in Avro, and how is it defined?
A map is a list of string keys and associated values of the same type, e.g., {“type”: “map”, “values”: “string”}.
What is the most common use case for Unions in Avro?
Defining optional fields, e.g., {“name”: “middle_name”, “type”: [“null”, “string”], “default”: null}.
Name four common Avro logical types.
- Decimal
- Date
- Time-millis
- Timestamp-millis
What is the difference between Generic and Specific Records in Avro?
- Generic Record uses schemas at runtime and is less safe.
- Specific Record is generated from the schema using build tools like Maven, providing type safety.
What is backward compatibility in Avro schema evolution?
A new schema can read old data.
What is forward compatibility in Avro schema evolution?
An old schema can read new data, with additional fields in the new schema being ignored.
What is full compatibility in Avro schema evolution?
Changes allow both forward and backward compatibility. Fields added must have defaults, and fields removed must also have defaults.