---
title: "Importing Kafka data"
description: "SurrealDB's Surreal Sync tool can be used to import Kafka data to SurrealDB."
canonical_url: "https://surrealdb.com/docs/integrate/migrating/from-files-and-streams/kafka"
section: "From files and streams"
surrealdb_version: "4.x"
last_modified: "2026-11-18T02:09:16Z"
---

> Full SurrealDB documentation index: https://surrealdb.com/docs/llms.txt

# Importing Kafka data

SurrealDB's Surreal Sync tool can be used to import Kafka data to SurrealDB.

Kafka data can be imported to SurrealDB using the Surreal Sync tool, as follows:

* The specified Kafka topic becomes a table in SurrealDB, where each message from the topic becomes a record in the table, with configurable deduplication.
* Each Kafka message must be encoded using Protobuf. The Kafka source decodes every message payload using Protobuf and converts it into SurrealDB Upsert queries, transforming the payloads into SurrealDB records.
* Message Key Strategy: Use Kafka message keys as record IDs (base64 encoded)
* Field Strategy: Extract IDs from a field in the message payload (default: "id" field)

For more on how to import Kafka data to SurrealDB, please see the [Kafka Source Usage Guide](https://github.com/surrealdb/surreal-sync/blob/main/docs/kafka.md) page in the Surreal Sync repo.
