Dataset
Apache Kafka topic event stream datasets for AI training
An Apache Kafka dataset is a read-out of chosen topics from a business's Kafka cluster over a stated period: each record with its key, value, headers, timestamp, partition and offset, plus the registered schemas that decode the values. Typical topics carry orders, payments, clicks, sensor readings and change events captured from databases. SourceX sources it to a buyer's spec from established businesses that run Kafka between their systems. Each dataset is de-identified, including personal and payment data inside event payloads, and licensed for an agreed permitted use.
Dataset manifest
Sourced to your spec- What it is
- Records of chosen topics, decoded with their registered schemas, with partition, offset, timestamp, key and headers kept
- Typical systems
- Apache Kafka clusters, self-run or managed, with their schema registry, Kafka Connect connectors and Kafka Streams changelog topics where in scope
- Typical history
- Set by each topic's retention and cleanup policy; often a recent window on the brokers, longer where a sink connector archived the topic
- Modality
- Ordered event records per partition; values decoded from Avro, Protobuf or JSON, with keys and headers
- Delivery formats
- JSONL or Parquet per topic and partition in offset order, with schema files by ID and version and a topic configuration manifest
- Preparation
- Personal, payment and credential data in payloads, keys and headers removed or replaced; pseudonyms kept stable so keys still group; internal topics left out
- Licensing
- Scoped per topic and offset or time range; permitted use agreed per license; rights of upstream data owners in each topic checked
- Availability
- Sourced to your spec; depth of history depends on retention and archives, and supply is not guaranteed
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| topic | string | The topic the record was read from, as named on the cluster. |
| topic_config | object | The topic's cleanup.policy, retention settings and partition count at the time of the read, from its configuration. |
| partition | integer | The partition of the topic that holds the record; order is defined only among records of one partition. |
| offset | integer | The record's position in its partition's log, assigned by the broker; gaps are normal on compacted and transactional topics. |
| timestamp | string | The record timestamp, converted from epoch milliseconds. |
| timestamp_type | enum | CreateTime when the producer set the timestamp or LogAppendTime when the broker did, per the topic's message.timestamp.type. |
| key | string | The record key, decoded and pseudonymized; under the default partitioner its hash chose the partition, and compaction keeps the latest record for it. |
| headers | array | Record headers as name and value pairs, such as event type, source service and trace context, decoded from bytes where the convention is known. |
| schema | object | The schema ID read from the serialized value's prefix, with the Schema Registry subject, version and format it resolves to. |
| event_type | string | The event name where one topic carries several record types, taken from a header or payload field by the producer's convention. |
| value | object | The record value decoded with its writer schema; null on a tombstone, which marks its key as deleted on a compacted topic. |
| source_connector | string | For topics written by Kafka Connect, the source connector that produced them, such as a Debezium connector, from the Connect configuration. |
| read_meta | object | Whether the record was consumed from a broker or taken from sink connector files, with the isolation level and read time. |
Field names from the table above; values are masked placeholders.
Example record
{
"topic": "payments.authorization.v1",
"topic_config": {
"cleanup_policy": "delete",
"partitions": 12
},
"partition": 7,
"offset": 48211937,
"timestamp": "2024-09-12T14:03:27.418Z",
"timestamp_type": "CreateTime",
"key": "ord_5c1e77a0",
"headers": [
{
"name": "event_type",
"value": "PaymentAuthorized"
},
{
"name": "source_service",
"value": "checkout-api"
},
{
"name": "traceparent",
"value": "[TRACE_CONTEXT_REMOVED]"
}
],
"schema": {
"id": 412,
"subject": "payments.authorization.v1-value",
"version": 6,
"format": "AVRO"
},
"event_type": "PaymentAuthorized",
"value": {
"order_id": "ord_5c1e77a0",
"customer_id": "cus_91b3d2",
"amount": {
"currency": "USD",
"minor_units": 18450
},
"payment_method": {
"type": "card",
"network": "[CARD_NETWORK]",
"last4": "[REMOVED]"
},
"attempt": 2,
"risk_score": 0.12,
"authorized_at": "2024-09-12T14:03:27.301Z"
},
"source_connector": null,
"read_meta": {
"route": "consumer",
"isolation_level": "read_committed",
"read_at": "2024-10-01T03:20:11Z"
}
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Train coding agents on event-driven systems
Real topics with their schemas show how to write consumers that cope with duplicates, late records and per-partition order.
Model sequences of business events
Records grouped by key give ordered chains such as created, paid, shipped and refunded for next-event and anomaly models.
Practice schema evolution
Successive schema versions with the records written under each make tasks in compatibility checking and migration code.
Rebuild state from change events
Change data capture topics that begin with the connector's initial snapshot let a test harness rebuild a table as it stood at any later offset.
Evaluate stream processing agents
Deduplication, windowed joins and tombstone handling have checkable answers when offsets and keys are intact.
Use-case guides: Coding agents, Enterprise and computer-use agents, Private evaluation sets
What makes this data valuable
Schemas for the whole period
Every schema ID found in the records resolves to a delivered schema, subject and version.
Partitions and offsets kept
Order can be rebuilt and gaps explained only when both travel with each record.
Topic settings on record
Cleanup policy, retention and partition count say whether a topic is history, a window or current state.
Stable pseudonymous keys
The same key maps to the same pseudonym across topics, so per-key sequences survive de-identification.
Known producers
The owner can name the service or connector behind each topic.
An archive beyond retention
Sink connector files that kept keys, headers and offsets extend history past what the brokers hold.
Record timeline
Apache Kafka dataset
One topic name, three kinds of history
A Kafka topic is an append-only log split into partitions, and a record's offset is its position in one partition. Order exists only there. The default partitioner hashes the record key, so every record for one order or one customer lands in the same partition, in the order the broker appended it, for as long as the partition count stays the same. Add partitions and later records for that key can go elsewhere. Across partitions there is no order, only timestamps, and those are normally the producer's clock unless the topic is set to stamp records with the broker's append time.
What a topic still holds depends on two settings. With cleanup.policy set to delete, the broker drops whole log segments once they pass the retention time or size. The default retention time is seven days, so a topic named orders may hold last week and nothing earlier. With compact, the broker keeps at least the latest record for each key and removes older ones in the background. A record with a null value, a tombstone, deletes its key and is later removed itself. A compacted topic is a current-state table, though its newest stretch can still hold several records per key. A topic kept with retention switched off is a full event history. Only the topic configuration says which.
The log also keeps what producers sent, mistakes included. A producer that retried without idempotence can leave duplicates. Topics written in transactions contain control markers that use up offsets, and aborted records stay in the log, visible to any reader not set to read_committed. Records are never edited, so a correction is a later record, which must fall inside the window you license.
Values are bytes until a schema registry decodes them
To a broker, a key and a value are byte arrays. Their format is a convention among producers, most often Avro, Protobuf or JSON Schema managed through a schema registry. The registry is a separate service, not part of Apache Kafka, and Confluent Schema Registry is a widely used one. Its serializers put a short prefix holding a schema ID in front of each payload, and the reader fetches that schema to decode it. Avro binary carries no field names, so the bytes are unreadable without the exact writer schema. Schemas sit under subjects, by default named after the topic, as numbered versions. A topic read over a long period holds records written under several versions, and every one of them has to come with the data. Topics of plain JSON have no registered schema, and their fields drift without notice.
Kafka has no command that exports a topic as a dataset. One route is to consume: a job reads each partition from its earliest retained offset to a fixed end offset, using a client, kcat or the console consumer, and gets the key, value, headers and timestamp of everything still there. A new consumer group left on defaults starts at the latest offset and returns nothing old. The other route is the files a sink connector already wrote to object storage, which often reach back further than the brokers. Those files hold what the connector was configured to keep, sometimes reshaped by transforms. Confluent's Amazon S3 sink connector, for one, writes values only unless it is set to store keys and headers, and has to be told to write tombstones. Copies made by MirrorMaker keep the records but not their offsets.
To test a sample, check that offsets run without unexplained gaps in each partition. Resolve every schema ID that appears. Compare the earliest timestamp per partition with the period claimed. Confirm that the records of ten keys each sit in one partition. On change data capture topics, check that initial snapshot records are told apart from live changes.
What to check before licensing
- Have the data owner and your counsel check the terms of the Kafka distribution or managed service and of the schema registry in use, on exported data and API use.
- Ask for each topic's cleanup.policy, retention settings and partition count, and whether any changed, then compare the earliest record timestamp per partition with the history claimed.
- List every schema ID in the sample and confirm the delivery holds the schema for each, with subject and version, covering the whole period.
- Check de-identification of personal and payment data in payloads, keys and headers, including card data, emails used as keys and free-text fields.
- Ask whether records were consumed from the brokers or taken from sink connector files, and for files, which of key, headers, partition, offset and tombstones the connector kept.
- Ask who produces each topic and whose data it carries, since topics fed by partners, customer tenants or third-party connectors may not be the business's to license.
- Ask whether producers were idempotent, which isolation level the read used and whether events carry their own unique ID, then count duplicates in the sample.
Delivery No files move before a signed license. A listing or a request grants no files by itself.
How licensing works through SourceX
- 1
Define
Send the domain, modality, volume, format, timeline and permitted use you need.
- 2
Source
SourceX identifies businesses that hold matching data and are open to licensing it.
- 3
Qualify
Fit, rights and quality are checked, and you review samples before committing.
- 4
License
Scope, permitted use, exclusivity, price and obligations are agreed in writing.
- 5
Deliver
Approved data is prepared, de-identified where required and transferred securely.
Questions Acquisition Partners ask
How far back does data in a Kafka topic go?
Only as far as the topic's retention allows, which is often days or weeks on the brokers. Kafka deletes old log segments by time or size unless a topic is compacted or kept without a limit. Longer history usually comes from an archive, such as files a sink connector wrote to object storage.
Can a topic be delivered without its schema registry?
Not usefully when the values are Avro or Protobuf. The bytes carry a schema ID, not the schema, so they cannot be decoded without the registered schemas for every version used in the period. Ask for decoded records together with the schema files for every version, so you never need access to the registry itself.
Is the order of events preserved?
Within a partition, yes, through the offset delivered with each record. Kafka does not define an order across partitions, so events for different keys can only be interleaved by timestamp, which is usually the producer's clock. Events for the same key normally share a partition, unless the partition count changed during the period.
What is the difference between a compacted topic and a normal one?
A compacted topic keeps at least the latest record for each key and discards older ones over time, while a normal topic keeps every record until retention removes it. Compacted topics, such as the changelog topics behind Kafka Streams tables, describe current state: one customer profile per customer ID, for example. They suit lookups and joins, not studying how a value changed over time.
Are database change events from Kafka Connect in scope?
They can be, where the business owns the source tables. A change data capture connector such as Debezium by default writes one topic per table, each record holding the row before and after the change, the operation and source metadata. The before image is present only if the source database logs it. These topics need the same de-identification as the tables behind them.
Is SourceX affiliated with the Apache Software Foundation?
Apache Kafka is named to identify the system the records come from. That does not imply a partnership with or endorsement by the Apache Software Foundation. The records belong to the business that runs Apache Kafka, which licenses them under a signed agreement, and a request does not guarantee a matching dataset. Buyers should still confirm with counsel that the vendor's terms allow the intended use of exported data.
Related datasets
- Web and product analytics events
Event-level logs from a first-party site or app, with the tracking plan and keys to business outcomes
- Production logs and distributed traces
Logs, traces and metrics for incident and baseline windows, tied to the change that ended each incident
- Apache Airflow DAGs and run histories
The DAG repository with its commit history, dag_run and task_instance rows from the metadata database, and the task logs that survive
- ClickHouse event tables
Rows of chosen tables and materialized view targets with their CREATE statements, engines, part metadata and, optionally, the query log
- Amazon S3 bucket contents
Objects copied from chosen buckets or prefixes, with keys, metadata, tags, storage classes and, where versioning was on, noncurrent versions and delete markers
Evaluating this data for procurement?
Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.
Request dataset diligenceTell us what your models need
Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.
Updated 26 November 2026.