All systems

Case study · Jeeny · Observability

A real-time view of payments, offers and rides

I built a real-time observability platform for payments, driver offers and rides. Events flow from Kafka into Cassandra, Spark jobs turn them into analytics, and the Matrix dashboards show the results, with 99.9% visibility across the system.

My role
Built the platform
Stack
Kafka, Cassandra, Spark, MongoDB
Scope
Payments, driver offers, rides
99.9%visibility across the system
3domains in one view

How it works

The problem

Payments, driver offers and ride analytics were scattered and unreliable, so it was hard to see the whole system at once.

My part

I built the platform: the Java consumer that writes the events to Cassandra, the Spark jobs that derive the analytics, and the MongoDB store that the Matrix dashboards read.

Key decisions

  1. A reactive Java consumer (Flux) reads the Kafka streams that the services already produce, so the services need no change.
  2. Spark jobs write ready-made analytics to MongoDB, so the Matrix dashboards read small results, not the raw events.
  3. The team watches live counts of payments, driver offers and rides per minute. When a count drops below its normal range, an alert goes to the on-call engineer.

Code

LiveCounts.javaJava
// Sketch of the patternDataset<Row> events = spark.read()    .format("org.apache.spark.sql.cassandra")    .option("keyspace", "events")    .option("table", "ride_events")    .load(); events.groupBy(window(col("created_at"), "1 minute"), col("domain"))    .count()    .write()    .format("mongodb")    .option("collection", "live_counts")    .mode("append")    .save();

A short sketch of the pattern.

Results

  • 99.9% visibility across the system.
  • Payments, driver offers and rides in one view.