Refresher on ๐—ฅ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐——๐—ฎ๐˜๐—ฎ from ๐—ž๐—ฎ๐—ณ๐—ธ๐—ฎ.


๐—ฅ๐—ฒ๐—บ๐—ถ๐—ป๐—ฑ๐—ฒ๐—ฟ:


➡️ Clients writing to Kafka are called ๐—ฃ๐—ฟ๐—ผ๐—ฑ๐˜‚๐—ฐ๐—ฒ๐—ฟ๐˜€.

➡️ Clients reading the Data are called ๐—–๐—ผ๐—ป๐˜€๐˜‚๐—บ๐—ฒ๐—ฟ๐˜€.

➡️ Data is written into ๐—ง๐—ผ๐—ฝ๐—ถ๐—ฐ๐˜€ that can be compared to tables in Databases.

➡️ Messages sent to ๐—ง๐—ผ๐—ฝ๐—ถ๐—ฐ๐˜€ are called ๐—ฅ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ๐˜€.

➡️ ๐—ง๐—ผ๐—ฝ๐—ถ๐—ฐ๐˜€ are composed of ๐—ฃ๐—ฎ๐—ฟ๐˜๐—ถ๐˜๐—ถ๐—ผ๐—ป๐˜€.

➡️ Each ๐—ฃ๐—ฎ๐—ฟ๐˜๐—ถ๐˜๐—ถ๐—ผ๐—ป is a combination of and behaves as a write ahead log.

➡️ Data is written to the end of the ๐—ฃ๐—ฎ๐—ฟ๐˜๐—ถ๐˜๐—ถ๐—ผ๐—ป.

➡️ Each ๐—ฅ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ has an ๐—ข๐—ณ๐—ณ๐˜€๐—ฒ๐˜ assigned to it which denotes its order in the ๐—ฃ๐—ฎ๐—ฟ๐˜๐—ถ๐˜๐—ถ๐—ผ๐—ป.

➡️ ๐—ข๐—ณ๐—ณ๐˜€๐—ฒ๐˜๐˜€ start at 0 and increment by 1 sequentially.


๐—ฅ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐——๐—ฎ๐˜๐—ฎ:


➡️ Data is read sequentially per partition.

➡️ ๐—œ๐—ป๐—ถ๐˜๐—ถ๐—ฎ๐—น ๐—ฅ๐—ฒ๐—ฎ๐—ฑ ๐—ฃ๐—ผ๐˜€๐—ถ๐˜๐—ถ๐—ผ๐—ป can be set either to earliest or latest.

➡️ Earliest position initiates the consumer at offset 0 or the earliest available due to retention rules of the ๐—ง๐—ผ๐—ฝ๐—ถ๐—ฐ (more about this in later episodes).

➡️ Latest position initiates the consumer at the end of a ๐—ฃ๐—ฎ๐—ฟ๐˜๐—ถ๐˜๐—ถ๐—ผ๐—ป - no ๐—ฅ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ๐˜€ will be read initially and the ๐—–๐—ผ๐—ป๐˜€๐˜‚๐—บ๐—ฒ๐—ฟ will wait for new data to be written.

➡️ You could codify your consumers independently, but almost always the preferred way is to use ๐—–๐—ผ๐—ป๐˜€๐˜‚๐—บ๐—ฒ๐—ฟ ๐—š๐—ฟ๐—ผ๐˜‚๐—ฝ๐˜€.


๐—–๐—ผ๐—ป๐˜€๐˜‚๐—บ๐—ฒ๐—ฟ ๐—š๐—ฟ๐—ผ๐˜‚๐—ฝ๐˜€:


➡️ ๐—–๐—ผ๐—ป๐˜€๐˜‚๐—บ๐—ฒ๐—ฟ ๐—š๐—ฟ๐—ผ๐˜‚๐—ฝ is a logical collection of clients that read a Kafka Topic and share the state.

➡️ Groups of consumers are identified by the ๐—ด๐—ฟ๐—ผ๐˜‚๐—ฝ_๐—ถ๐—ฑ parameter.

➡️ ๐—ฆ๐˜๐—ฎ๐˜๐—ฒ is defined by the offsets that every Partition in the Topic is being consumed at.

➡️ State of Consumer Groups is written by the Broker (more about this in later episodes) to an internal Kafka Topic named __๐—ฐ๐—ผ๐—ป๐˜€๐˜‚๐—บ๐—ฒ๐—ฟ_๐—ผ๐—ณ๐—ณ๐˜€๐—ฒ๐˜๐˜€.

➡️ There can be multiple Consumer Groups reading the same Kafka Topic having their own independent States.

➡️ Only one Consumer per Consumer Group can be reading a Partition at a single point in time.

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2054354075566928"
     crossorigin="anonymous"></script>

Comments

Popular Posts