DTX Conference 2025 in Birmingham focused on modern data engineering — from stream processing to lakehouse architectures. UUID v7 emerged as a cross-cutting theme: its timestamp prefix enables time-ordered storage in ClickHouse, Flink watermarking, and Kafka correlation without secondary timestamp columns.

Event details

ConferenceDTX Conference 2025
DateOctober 2–3, 2025
LocationBirmingham, UK
FocusUUID v7 in ClickHouse, Apache Flink, Kafka, and lakehouse architectures

Key sessions

UUID v7 in ClickHouse analytics

-- ClickHouse: UUID v7 primary key with built-in function (ClickHouse 24.5+)
CREATE TABLE events (
    id         UUID DEFAULT generateUUIDv7(),
    user_id    UUID NOT NULL,
    event_type String,
    payload    String,
    PRIMARY KEY (id)   -- UUID v7 sort order = chronological
) ENGINE = MergeTree()
ORDER BY id;

-- Time-range query using UUID v7 timestamp prefix
SELECT
    id,
    UUIDNumToString(id) AS id_str,
    toDateTime(reinterpretAsUInt128(id) >> 80 / 1000) AS created_at,
    event_type
FROM events
WHERE toDateTime(reinterpretAsUInt128(id) >> 80 / 1000) > now() - INTERVAL 1 HOUR
ORDER BY id
LIMIT 100;

See UUID v7 in ClickHouse.

// Flink: extract event time from UUID v7 message IDs
public class UuidV7TimestampAssigner implements AssignerWithPunctuatedWatermarks<KafkaEvent> {
    @Override
    public long extractTimestamp(KafkaEvent event, long previousTimestamp) {
        // UUID v7 top 48 bits = Unix milliseconds
        String uuidStr = event.getMessageId().replace("-", "");
        return Long.parseUnsignedLong(uuidStr.substring(0, 12), 16);
    }

    @Override
    public Watermark checkAndGetNextWatermark(KafkaEvent event, long extractedTimestamp) {
        return new Watermark(extractedTimestamp - 1000); // 1 second lag
    }
}

// Register with Flink stream
DataStream<KafkaEvent> stream = env
    .addSource(kafkaConsumer)
    .assignTimestampsAndWatermarks(new UuidV7TimestampAssigner());

See UUID v7 in Apache Flink.

Kafka correlation with UUID v7

// Producer: embed UUID v7 as Kafka message key for time-ordered partitioning
ProducerRecord<String, String> record = new ProducerRecord<>(
    "orders",
    UuidCreator.getTimeOrderedEpoch().toString(), // UUID v7 as message key
    orderJson
);

// Consumer: extract event time from UUID v7 key
ConsumerRecord<String, String> consumed = ...; // from poll()
String msgKey = consumed.key(); // UUID v7
long eventMs = Long.parseUnsignedLong(msgKey.replace("-", "").substring(0, 12), 16);
Instant eventTime = Instant.ofEpochMilli(eventMs);

See UUID v7 in Kafka Event Streaming.

Delta Lake with UUID v7 primary keys

from delta.tables import DeltaTable
from pyspark.sql.functions import expr

# Write Delta Lake table ordered by UUID v7 primary key
df.write \
    .format("delta") \
    .option("delta.dataSkippingNumIndexedCols", "1") \
    .sortBy("id") \  # UUID v7 — chronological sort order
    .save("/delta/events")

# Z-ordering on UUID v7 improves time-range scan performance
DeltaTable.forPath(spark, "/delta/events") \
    .optimize() \
    .executeZOrderBy("id")

Conference takeaways

  1. ClickHouse — generateUUIDv7() built-in from version 24.5; time-range queries use the timestamp prefix
  2. Apache Flink — UUID v7 event IDs replace explicit timestamp fields for watermark extraction
  3. Kafka — UUID v7 message keys give deterministic partition ordering within a key
  4. Delta Lake — UUID v7 sort order improves Z-ordering and file compaction efficiency
  5. Unified ID — one UUID v7 value serves as the primary key in the OLTP database, the Kafka message key, and the lakehouse partition sort key

Further reading

External references

Frequently asked questions

Why is UUID v7 preferred over UUID v4 for analytics databases?

UUID v7's 48-bit timestamp prefix enables time-range queries to prune storage ranges without a separate date partition column. In ClickHouse, ordering by UUID v7 primary key sorts rows chronologically — ORDER BY id replaces ORDER BY created_at. UUID v4 requires a secondary sort column for chronological queries. See UUID v7 in ClickHouse.

How does UUID v7 work in Apache Flink stream processing?

Flink processing-time watermarks can use UUID v7 event IDs to extract creation timestamps when event-time clocks are unavailable. UUID v7 event IDs embedded in Kafka messages carry their creation time in the first 12 hex digits. A Flink UDF can extract this to reconstruct event time: new Date(Long.parseLong(uuidStr.replaceAll("-", "").substring(0, 12), 16)). See UUID v7 in Apache Flink.

How does UUID v7 simplify data warehouse primary keys?

Data warehouses traditionally use surrogate keys (auto-increment integers) or natural keys (business IDs). UUID v7 combines both: it is globally unique (suitable as a surrogate key) and time-ordered (sortable like an auto-increment key). Lakehouse formats like Delta Lake and Iceberg benefit from UUID v7's sort order for Z-ordering and file compaction decisions.