appendix C Working with Avro, Protobuf, and JSON Schema
C.1 Apache Avro
An Avro schema is composed of two main types: primitive and complex. The supported primitive types are null
, boolean
, int
, long
, float
, double
, bytes
, and string
. Complex types are records
, enums
, arrays
, maps
, unions
, and fixed
. For a complete description of primitive and complex types, see the Avro documentation at http://mng.bz/Y7Oo and http://mng.bz/GZ2M, respectively.
In this book, you’ll mostly work with the complex type of record
as this corresponds to an object. You may also encounter a few examples using primitive values, but for the most part, we’ll stick with records. You’ll also use the union
type, especially when working with the RecordNameStrategy
Get Kafka Streams in Action, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.