Confluent Schema Registry Flashcards

1
Q

What is the purpose of the Schema Registry in the Kafka ecosystem?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Kafka REST Proxy, and how does it interact with Avro and Kafka?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the advantages of using Avro?

A
  • Fully typed data.
  • Automatic compression.
  • Schema travels with the data.
  • Embedded schema documentation.
  • Language-agnostic data readability.
  • Safe schema evolution.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the disadvantages of using Avro?

A
  • Limited support for some languages.
  • Data cannot be printed directly without using Avro tools, as it’s compressed and serialized.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name some primitive types supported by Avro.

A
  • null
  • boolean
  • int
  • long
  • float
  • bytes
  • string
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the common fields in an Avro Record Schema?

A
  • Name
  • Namespace
  • Doc (optional)
  • Aliases (optional)
  • Fields: Name, Doc, Type, Default
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the key rule when using Enums in Avro?

A

Once set, enum values cannot be changed to maintain compatibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does Avro define arrays?

A

As a list of items of the same schema, e.g., {“type”: “array”, “items”: “string”}.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a map in Avro, and how is it defined?

A

A map is a list of string keys and associated values of the same type, e.g., {“type”: “map”, “values”: “string”}.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the most common use case for Unions in Avro?

A

Defining optional fields, e.g., {“name”: “middle_name”, “type”: [“null”, “string”], “default”: null}.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Name four common Avro logical types.

A
  • Decimal
  • Date
  • Time-millis
  • Timestamp-millis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between Generic and Specific Records in Avro?

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is backward compatibility in Avro schema evolution?

A

A new schema can read old data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is forward compatibility in Avro schema evolution?

A

An old schema can read new data, with additional fields in the new schema being ignored.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is full compatibility in Avro schema evolution?

A

Changes allow both forward and backward compatibility. Fields added must have defaults, and fields removed must also have defaults.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Give examples of breaking changes in Avro schema evolution

A
  • Adding/removing elements from an Enum.
  • Changing a field’s type.
  • Renaming a required field.
17
Q

What is the format of the Content-Type header for Avro with Kafka REST Proxy?

A

application/vnd.kafka.avro.v2+json.

18
Q

List the steps for producing Avro data using Kafka REST Proxy.

A

Define schema in JSON format.
Produce data with the schema.
Retrieve schema ID for subsequent smaller requests.

19
Q

What are the steps to consume data using Kafka REST Proxy?

A
  • Create a consumer in a consumer group.
  • Subscribe to topics.
  • Retrieve and process records.
  • Commit offsets.
    *
20
Q

What are the topic operations in Kafka REST Proxy?

A
  • Get a list of topics
  • Get a specific topic