ReadSigil

Build · Banking data stack · Workshop 2 of 8

Post every transaction once. Prove it.

Harbour Bank · Monday 19 October · The Kafka posting consumer goes live once Risk signs it off.

Operational Risk to Data Platform09:05

Friday's duplicate came from a job that retried. I will sign off the new consumer when it survives what the switch actually sends: repeats, bad messages, crashes and month-end volume. Show me the evidence, not the design.

Topic upi.settled, 16 OctNot what it seems
Settled by NPCI1,800
Messages on the topic1,838
Partitions, keyed by account6

The test Risk will run

Your consumer runs twice from a clean ledger. Once alone, killed with SIGKILL at 20%, 50% and 80% of the way through and restarted each time. Then as three consumers in one group. After each run, six controls are audited against the ledger, NPCI's file and Kafka itself.

ControlWhat it proves
Every settled transaction posted exactly onceNo event lost, none posted twice
Both legs, opposite sides, same amountDouble entry holds for every posting
Ledger agrees with NPCIAll 240 accounts and the settlement GL tie to NPCI's file
Malformed message parked in the dead-letter topicBad data is quarantined, not dropped and not blocking
Consumer group caught up, offsets committedNothing left unread; a restart picks up cleanly
Each account posted in settlement orderParallelism has not reordered an account's history

You start from the first draft of the consumer. It fails most of these.

Start

This workshop runs Apache Kafka 4.1 and Postgres 17, so it needs a machine rather than a browser tab. A free GitHub Codespace is the quickest: Kafka and Postgres start on their own. GitHub Free includes about 60 hours a month on the 2-core machine it uses.

Open in GitHub CodespacesRead the workshop guide

Or on a laptop with Docker and Python 3.10 or later:

git clone https://github.com/shashwat-kumar/readsigil-data-stack
cd readsigil-data-stack
docker compose up -d --wait
pip install -e .
harbour doctor

Then, in either:

  1. harbour reset and harbour publish put 16 October's events on the topic. Look at them with Kafka's own console consumer.
  2. Run the first draft with python workshops/02-kafka/consumer.py, then harbour status. Work out what happened to the ledger and to the consumer group's offsets.
  3. Run harbour check ws2. Fix one failing control at a time. The guide has a hint for each, folded away until you want it.
Workshop 2 test statusOn every change, the reference consumer passes all six controls against real Kafka and Postgres, and the first draft plus three broken variants each fail the control that names their bug.
On a Cloudera/Hadoop stack

Cloudera's Streams Messaging is Apache Kafka, so consumer groups, offsets, partitions and the dead-letter pattern work exactly as in this workshop. In production you would add Streams Messaging Manager to watch consumer lag, Schema Registry so a malformed message is rejected when it is produced, and Ranger policies on who may write to the topic and who may read the dead-letter topic.

The workshop series

WorkshopSituationCloudera/Hadoop counterpart
1 · Postgres, DuckDBUPI settlement does not tie to the ledgerCore banking replica; Impala or Hive over HDFS/Ozone
2 · KafkaPost every transaction once, through repeats, crashes and month-end volumeKafka (Cloudera Streams Messaging)
3 · AirflowBackfill a broken week so each night is published onceOozie; Airflow in Cloudera Data Engineering
4 · Iceberg In preparationRestate the March book after a late correctionIceberg tables in CDP
5 · dbt Core In preparationOne definition of CASA ratio across fourteen reportsHive and Impala SQL jobs; dbt-hive and dbt-impala adapters
6 · Spark In preparationThe EOD batch slows because one corporate account fills one partitionSpark on CDP, Cloudera Data Engineering
7 · Metabase In preparationThe MD's morning dashboard, built on reconciled numbers onlyCloudera Data Visualization, Hue
8 · Capstone In preparationRun the whole end-of-day pipeline yourselfDocker on your laptop

Harbour Bank, its accounts and every figure here are fictional. The software, the controls and the failure modes are real.