0
0
Kafkadevops~10 mins

Schema compatibility rules in Kafka - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the schema compatibility to backward.

Kafka
schema_registry_client.update_compatibility(subject_name, '[1]')
Drag options to blanks, or click blank then click option'
ABACKWARD
BFORWARD
CFULL
DNONE
Attempts:
3 left
💡 Hint
Common Mistakes
Using FORWARD instead of BACKWARD
Using NONE disables compatibility checks
2fill in blank
medium

Complete the code to check if a new schema is compatible with the existing one.

Kafka
is_compatible = schema_registry_client.test_compatibility([1], new_schema)
Drag options to blanks, or click blank then click option'
Aschema_type
Bsubject_name
Cschema_version
Dschema_id
Attempts:
3 left
💡 Hint
Common Mistakes
Passing schema_id instead of subject_name
Confusing schema_version with subject_name
3fill in blank
hard

Fix the error in the code to set compatibility to FULL_TRANSITIVE.

Kafka
schema_registry_client.update_compatibility(subject_name, '[1]')
Drag options to blanks, or click blank then click option'
AFULL
BBACKWARD
CFORWARD_TRANSITIVE
DFULL_TRANSITIVE
Attempts:
3 left
💡 Hint
Common Mistakes
Using FULL instead of FULL_TRANSITIVE
Using FORWARD_TRANSITIVE which is different
4fill in blank
hard

Fill both blanks to create a schema compatibility check that ensures the new schema is backward compatible with the latest version.

Kafka
result = schema_registry_client.test_compatibility([2], [1])
Drag options to blanks, or click blank then click option'
Anew_schema
Bold_schema
Csubject_name
Dschema_version
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping new_schema and old_schema
Using schema_version instead of subject_name
5fill in blank
hard

Fill all three blanks to define a compatibility rule that sets the compatibility level to FORWARD and verifies it.

Kafka
schema_registry_client.update_compatibility(subject_name, [1])
current_level = schema_registry_client.get_compatibility(subject_name)
assert current_level == [2] and current_level == [3]
Drag options to blanks, or click blank then click option'
A'FORWARD'
D'BACKWARD'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing FORWARD and BACKWARD strings
Forgetting quotes around the string values