Categories
Innovation Software Architecture

What are the basics of ๐—ช๐—ฟ๐—ถ๐˜๐—ถ๐—ป๐—ด ๐——๐—ฎ๐˜๐—ฎ ๐˜๐—ผ ๐—ž๐—ฎ๐—ณ๐—ธ๐—ฎ?

Kafka is an extremely important ๐——๐—ถ๐˜€๐˜๐—ฟ๐—ถ๐—ฏ๐˜‚๐˜๐—ฒ๐—ฑ ๐— ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ถ๐—ป๐—ด ๐—ฆ๐˜†๐˜€๐˜๐—ฒ๐—บ to understand as it was the first of its kind and most of the new products are built on the ideas of Kafka.

๐—ฆ๐—ผ๐—บ๐—ฒ ๐—ด๐—ฒ๐—ป๐—ฒ๐—ฟ๐—ฎ๐—น ๐—ฑ๐—ฒ๐—ณ๐—ถ๐—ป๐—ถ๐˜๐—ถ๐—ผ๐—ป๐˜€:

โžก๏ธ Clients writing to Kafka are called ๐—ฃ๐—ฟ๐—ผ๐—ฑ๐˜‚๐—ฐ๐—ฒ๐—ฟ๐˜€,
โžก๏ธ Clients reading the Data are called ๐—–๐—ผ๐—ป๐˜€๐˜‚๐—บ๐—ฒ๐—ฟ๐˜€.
โžก๏ธ Data is written into ๐—ง๐—ผ๐—ฝ๐—ถ๐—ฐ๐˜€ that can be compared to ๐—ง๐—ฎ๐—ฏ๐—น๐—ฒ๐˜€ ๐—ถ๐—ป ๐——๐—ฎ๐˜๐—ฎ๐—ฏ๐—ฎ๐˜€๐—ฒ๐˜€.
โžก๏ธ Messages sent to Topics are called ๐—ฅ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ๐˜€.
โžก๏ธ Topics are composed of ๐—ฃ๐—ฎ๐—ฟ๐˜๐—ถ๐˜๐—ถ๐—ผ๐—ป๐˜€.
โžก๏ธ Each Partition behaves like and is a set of ๐—ช๐—ฟ๐—ถ๐˜๐—ฒ ๐—”๐—ต๐—ฒ๐—ฎ๐—ฑ ๐—Ÿ๐—ผ๐—ด๐˜€.

๐—ช๐—ฟ๐—ถ๐˜๐—ถ๐—ป๐—ด ๐——๐—ฎ๐˜๐—ฎ:

โžก๏ธ There are two types of records that can be sent to a Topic โ€“ ๐—–๐—ผ๐—ป๐˜๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด ๐—ฎ ๐—ž๐—ฒ๐˜† ๐—ฎ๐—ป๐—ฑ ๐—ช๐—ถ๐˜๐—ต๐—ผ๐˜‚๐˜ ๐—ฎ ๐—ž๐—ฒ๐˜†.
โžก๏ธ If there is no key, then records are written into Partitions in a ๐—ฅ๐—ผ๐˜‚๐—ป๐—ฑ ๐—ฅ๐—ผ๐—ฏ๐—ถ๐—ป ๐—ณ๐—ฎ๐˜€๐—ต๐—ถ๐—ผ๐—ป.
โžก๏ธ If there is a key, then records with the same keys will always be written to the ๐—ฆ๐—ฎ๐—บ๐—ฒ ๐—ฃ๐—ฎ๐—ฟ๐˜๐—ถ๐˜๐—ถ๐—ผ๐—ป.
โžก๏ธ Data is always written to the ๐—˜๐—ป๐—ฑ ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ ๐—ฃ๐—ฎ๐—ฟ๐˜๐—ถ๐˜๐—ถ๐—ผ๐—ป.
โžก๏ธ When written, a record gets an ๐—ข๐—ณ๐—ณ๐˜€๐—ฒ๐˜ assigned to it which denotes its ๐—ข๐—ฟ๐—ฑ๐—ฒ๐—ฟ/๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ ๐—ถ๐—ป ๐˜๐—ต๐—ฒ ๐—ฃ๐—ฎ๐—ฟ๐˜๐—ถ๐˜๐—ถ๐—ผ๐—ป.
โžก๏ธ Partitions have separate sets of Offsets starting from 1.
โžก๏ธ Offsets are incremented sequentially when new records are written.

Any insights you would add about writing data to Kafka? Let me know in the comment section ๐Ÿ‘‡

Leave a Reply Cancel reply