# 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.
