Migrating the Pipeline: Tracking Clickstream Events

Bora Kaplan5 Jan 2023

Problem

GetYourGuide's data platform team owned one Thrift repository with every event schema, so each new or changed event went through that team. Producer teams had no ownership. The same event was sent with different properties and every field was nullable, so data quality suffered and nobody monitored the flow. Collector, the ingestion service, did all validation and enrichment, which made responses slow. The move to microservices made it worse, because a service sees only its own context and cannot send a complete event.

Example from the article: a CurrencyChangeAction event has the fields currency, old_currency and new_currency, plus two property groups: producer_properties and enriched_properties.

Solution in brief

Events became JSON described in OpenAPI and AsyncAPI schemas, served by a schema registry. Each producer team owns its events and their alarms. A Kafka Streams layer enriches each event by joining it with the gateway's HTTP event. Events were switched to the new pipeline one by one over a year, with the old pipeline kept running.

Questions this case answers
  • How to move an event-tracking pipeline to producer-owned strict schemas while data consumers keep working on unchanged data
  • How to enrich events in real time when producing services only know part of the event context
  • How to move a clickstream pipeline from a central schema repository to producer-owned event schemas
  • How to add events that microservices cannot fully describe from their own context

Tools and methods

  • Collector — ingestion service that validates the schema and publishes to an intermediate Kafka topic.
  • Apache Kafka — transport, with one topic per event and a topic for analytical events.
  • Analytics Enrichment Pipeline — Kafka Streams applications in Scala that enrich events in real time.
  • Schemapi Registry — publishes schemas through CI plugins.
  • OpenAPI and AsyncAPI — strict syntactic and semantic event definitions.
Continue reading — it's free

Google or a one-time email code. No password.