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
Post a Comment