Home / Resources / Ebooks / When Kafka Becomes The Ledger

Whitepaper

When Kafka Becomes the Ledger

When transaction and payment data lives on Kafka, much of fintech's correctness work moves from apps to the proxy. A control-plane operating model.

When Kafka Becomes the Ledger

Conduktor works with banks, payment processors, card networks, and digital banks that run Apache Kafka. The data that moves money has moved onto Kafka, and the controls that keep it correct and access-governed are often spread across many application teams and multiple clusters.

Many reimplement their own field encryption, deduplication logic, and schema checks. When the platform team faces an audit, it has no unified visibility, because that logic and enforcement sit in the wrong place.

This paper is about an operating model, one we call the Kafka control plane, that puts that enforcement in one central place, so a platform team can prove correctness, retention, and access to an auditor.

It is written for the person who owns the Kafka estate inside a regulated fintech: the Platform or Streaming Lead. It is meant to be co-signed by the people who share the risk:

  • The CISO, who wants an independent enforcement layer over managed Kafka.
  • The Head of Data or DPO, who owns the tension between GDPR erasure and AML retention.
  • The CTO, who owns the build-versus-buy decision.

Scope. By transaction and payment data we mean the streams that move money and prove it moved: payments, ledger entries, settlement, reconciliation, KYC, and audit streams. Low-latency trading and market data are out of scope, because they play by different rules (deliberate duplication to win a race, disposable intermediate state because only the latest price matters).

Note that Kafka cannot be the ledger: funds reservation, overdraft handling, and balance invariants need linearizability and belong in a transactional store. The control plane owns only the delivery-layer correctness.

For a listed fintech, or a subsidiary of a US-listed parent, there is a further layer: the moment these streams feed financial reporting, the streaming platform falls inside SOX IT general controls (ITGC), namely change control over what shapes the data, logical access over who can touch it, and IT operations over retention and recovery. SOX is mostly an organizational program of controls and ownership that no tool provides; what a control plane can provide is the ITGC evidence an auditor asks for.

When Kafka becomes the system of record

This data is on Kafka because of what it provides:

  • Outbox and change-data-capture. Get a committed state change reliably onto a topic.
  • Event sourcing. Make the log the source of truth that state is derived from.
  • Audit trails. Append-only records of what happened, who did it, and why.
  • Webhook ingestion. Land external transaction events on a topic before anything internal touches them.

In each of these the streaming layer is the system of record, not a buffer. Kafka has become the ledger of record for delivery, even when the authoritative balance lives elsewhere.

"Accountants don't use erasers." — an old accounting adage

Finance has always worked this way. You never alter a posted entry, you add a correcting one, so the mistake and its fix both stay on the record for an auditor to follow. An append-only log is that same discipline expressed as a data structure, which is why correcting a reconciliation break with an UPDATE in a database is a fast track to a compliance finding. Kafka hands you the append-only structure for free; the guarantee that no one can quietly rewrite it is the part you still have to enforce.

"Of course we need that, because our Kafka usage is for the payment and transaction of data." — Platform engineering lead, digital retail bank

When Kafka carries transaction and payment data, every application team ends up re-implementing that correctness work on its own. One team writes its own field-encryption wrapper, another its own dedup barrier and schema checks in consumer code, and others mask PII before logging.

The platform team handles the ACLs and the audit burden centrally, and cannot push all the controls it needs down to the application teams: that is too scattered and creates too much friction. So the work ends up half in the apps and half on the platform, inconsistent and hard to prove.

To run Kafka inside its PCI-DSS zone, Afterpay's payments platform built three controls into client code, because standard Kafka clients do none of that:

  • Card-number detection and obfuscation into a custom Avro serializer.
  • HMAC message-integrity verification against a KMS key, into custom producer and consumer libraries.
  • A chain of PrivateLink hops to keep cardholder data away from teams that should not see it.

It's the per-team model this paper is about: every one of those controls lives in client code that each team has to build, ship, and maintain, and the next team that touches it starts over.

A fintech often runs a mix of self-managed Apache Kafka (on premises), AWS MSK, Confluent Cloud, or another flavor, each with its own access model, audit output, and encryption practice. There is no single place to apply one policy or prove one control. Governance is partial, and full of unknown unknowns.

"And then we got derailed by all the audit stuff that we have to comply with and the findings. Right now March is all about compliance and getting our audit stuff in place for the entire team." — Platform / security manager, payments processor

Compliance should not be a one-off task; it should be continuous. Today, when compliance work arrives, it is scattered across clusters and apps, and the platform team generally loses a big chunk of its roadmap to assembling the evidence by hand.

Money software reduces to three principles, the ones the Fintech Engineering Handbook by Voytek Pituła names: no invented data, no lost data, no trust. The first two are about the data. The third, no trust, is about everyone who touches it: verify everything, and trust no source by default, not a provider, not another service, not your own operators. On Kafka, each one becomes something to enforce:

  • No invented data means idempotency.
  • No lost data means durability and erasure on an immutable log.
  • No trust means controlling who and what can touch the streams.

Per-app and per-cluster enforcement

The way Kafka is governed today is generally not enough, because enforcement is either incomplete or in the wrong place:

Kafka ACLs are coarse and insufficient. Broker ACLs and authorizer logs record authorization grants and denials, not per-record consumption. Consumer-group offsets show progress, not identity-attributed reads. PCI Requirements 8 and 10 expect an audit trail that ties every access to cardholder data back to a named identity, so the question they force, who actually read this PAN (the cardholder's card number), is unanswerable at the data layer.

You need identity-bound access to answer who is authorized and who is connected. DORA imposes similar access-control and audit-trail obligations. Shared service-account credentials, which are often the norm in Kafka clients (and in tooling that reuses existing ones), break the unique-ID attribution that PCI requires: several humans and tools hide behind one principal.

This is also the classic SOX finding on a streaming estate: a service account nobody can identify still has write access to the general-ledger integration, and no one can say who granted it or who uses it. It is a segregation-of-duties gap in ITGC terms, a producer identity with an uncontrolled write path into financial reporting, and it is unanswerable at the broker, where authorization logs record grants and denials but not the human behind the principal.

No schema enforcement. Any producer with write permissions can put a malformed or unbalanced transaction record on a topic, or serialize an amount as a bare JSON number (an IEEE-754 double, so money crossing the wire that way silently loses precision). Even when you have a Schema Registry, it does not enforce anything on the wire.

Operators are Gods. Anyone with produce or admin rights can delete records, write tombstones, or change retention. An audit trail they can edit proves nothing to a regulator.

At-least-once means duplicates are guaranteed. A retry, a consumer-group rebalance, or a consumer rewinding its offset all redeliver events you have already seen. Exactly-once delivery across system boundaries (an external PSP, a webhook) is impossible, and Kafka's own exactly-once semantics cover only Kafka-to-Kafka flows, which is precisely why an application-level idempotency pattern is still needed end to end. If the dedup barrier does not sit somewhere shared, every consumer has to reinvent its own idempotency check, or risk applying a money-moving effect twice.

Encryption at rest and TLS in transit are necessary and not sufficient. PCI Requirement 3 is explicit that disk-level encryption alone does not protect stored PAN, and Requirement 4 expects strong transport encryption even on internal segments. At-rest encryption is transparent to the broker, so managed Kafka serves the data in whatever form the producer wrote it, plaintext the moment it is served: to an authenticated client, to a leaked credential, and to the provider's own break-glass operator inside their proxy. At-rest encryption protects a stolen or decommissioned disk, not the running broker, and pushing encryption client-side instead just moves the key-management burden onto every application team.

Encryption keeps the PAN in scope; only tokenization takes it out. A field-level-encrypted PAN is still a reversible representation of the PAN, so the PCI SSC treats the ciphertext as cardholder data in scope: encrypting the topics protects the data but does not remove the brokers and consumers from the CDE.

Tokenization is different. It replaces the PAN with a token that has no mathematical relationship to it, the mapping held in a segmented vault, so a topic carrying only tokens holds no cardholder data. Do it before the produce, and the log and every consumer downstream fall outside the CDE, subject to your QSA's scope determination. That shrinks a SAQ D assessment; it does not make you SAQ A eligible, since you still ingest the raw PAN at the edge. Format-preserving tokens keep schema validation and downstream joins working on a value shaped like a PAN, and what stays in scope is the ingestion edge and the vault itself.

"From my understanding, you're encrypting the data for your client using Conduktor before it hits Confluent Cloud?" — Integration architect, retail & commercial bank

That is the move: protect the data before it reaches the managed cluster, without making every app own an encryption library.

Erasure. A GDPR request asks you to erase from a system that cannot be edited, where the data is replicated, sitting in long-lived compacted topics or topics with infinite retention (especially with Kafka Streams or ksqlDB), in tiered storage, copied across clusters, and duplicated by every downstream application into its own topics and databases.

A common misconception: Kafka is not just a temporary buffer. Whether you like it or not, how it is used naturally leads to data being stored there indefinitely, whether through infinite retention (the full history stays) or compaction (the latest value per key stays), so anyone can sweep a topic and extract the current state of every entity still on it.

Meanwhile AML requires record-keeping, and for crypto-asset service providers, MiCA requires that the same personal data be kept. A per-app deletion script cannot resolve a retain-versus-delete conflict on an append-only log.

Keep reading the full guide

By submitting this form, you acknowledge that your information will be processed in accordance with our Privacy Policy.