Kafka by Neha Narkhede
Author:Neha Narkhede
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2017-08-15T04:00:00+00:00
Converters and Connect’s data model
The last piece of the Connect API puzzle is the connector data model and the converters. Kafka’s Connect APIs includes a data API, which includes both data objects and a schema that describes that data. For example, the JDBC source reads a column from a database and constructs a Connect Schema object based on the data types of the columns returned by the database. It then uses the schema to construct a Struct that contains all the fields in the database record. For each column, we store the column name and the value in that column. Every source connector does something similar—read an event from the source system and generate a pair of Schema and Value. Sink connectors do the opposite—get a Schema and Value pair and use the Schema to parse the values and insert them into the target system.
Though source connectors know how to generate objects based on the Data API, there is still a question of how Connect workers store these objects in Kafka. This is where the converters come in. When users configure the worker (or the connector), they choose which converter they want to use to store data in Kafka. At the moment the available choices are Avro, JSON, or strings. The JSON converter can be configured to either include a schema in the result record or not include one—so we can support both structured and semistructured data. When the connector returns a Data API record to the worker, the worker then uses the configured converter to convert the record to either an Avro object, JSON object, or a string, and the result is then stored into Kafka.
The opposite process happens for sink connectors. When the Connect worker reads a record from Kafka, it uses the configured converter to convert the record from the format in Kafka (i.e., Avro, JSON, or string) to the Connect Data API record and then passes it to the sink connector, which inserts it into the destination system.
This allows the Connect API to support different types of data stored in Kafka, independent of the connector implementation (i.e., any connector can be used with any record type, as long as a converter is available).
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8309)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6788)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6765)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6648)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6437)
Driving Data Quality with Data Contracts by Andrew Jones(6376)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6137)
Learning SQL by Alan Beaulieu(6003)
Weapons of Math Destruction by Cathy O'Neil(5795)
Big Data Analysis with Python by Ivan Marin(5388)
Data Engineering with dbt by Roberto Zagni(4391)
Solidity Programming Essentials by Ritesh Modi(4041)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3899)
Pandas Cookbook by Theodore Petrou(3600)
Blockchain Basics by Daniel Drescher(3305)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2914)
Feature Store for Machine Learning by Jayanth Kumar M J(2819)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2802)
Mastering Python for Finance by Unknown(2748)
