~/talk

Designing Payloads for Event-Driven Systems

Practical rules for Apache Kafka payloads: use apache kafka keys and headers (route partitions, put small lookup-friendly metadata in headers), always send a top‑level object and grouped fields, keep messages under one meg and favour lightweight representations or hypermedia links over embedding files, include ISO timestamps and open telemetry trace/span ids, use Avro or Protobuf with a schema registry (Carapace), evolve schemas only backwards‑compatibly or publish a new topic (e.g. topic.v0 → topic.v1) and use go‑gen‑avro + Confluent clients for Go.

AI-written summary · about

  1. 0:00Intro
  2. 0:33Event-Driven Systems
  3. 2:11Apache Kafka "Apache Kafka is an open-source distributed event streaming platform"
  4. 3:04Payloads The messages the machines send between themselves • Large string/binary data • No rules
  5. 4:07Apache Kafka Records Use all the features of Apache Kafka's records
  6. 7:05Flat or Nested Structures? • Always use a top level object structure (not an array) Group related fields together
  7. 8:53More Data or Less Data? • For small payloads, add the context fields • Use lightweight representation rather than the full
  8. 11:06Example: GitHub Webhooks (snippet from the push webhook)
  9. 12:54A Note on Timestamps • Apache Kafka includes publish time in the header. . Consider adding payload-level timestamps. • Timestamps only as accurate as your clock!
  10. 14:36Event Tracing Standards are great! • Trace ID used by every event in the story • Span ID in event, becomes Parent Span ID for child
  11. 18:46Schemas Schemas enforce payload structure • Avro format requires a schema
  12. 20:12Evolving Schemas • Aim for backwards-compatible changes
  13. 23:05Example: Avro Schema Avro schema example for sensor data
  14. 24:04GoGen makes Avro Structs gogen-avro avro machine sensor.avsc
  15. 24:42Go with Kafka and Avro
  16. 25:33AsyncAPI for Apache Kafka AsyncAPI describes event-driven architectures
  17. 26:00Describing Payloads The channels section of the AsyncAPI document
  18. 26:19Documenting Payloads
  19. 27:07Resources • Examples
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.