Here is what ๐๐-๐๐ฒ๐ฎ๐๐/๐ ๐ผ๐๐ ๐ข๐ป๐ฐ๐ฒ ๐ฃ๐ฟ๐ผ๐ฐ๐ฒ๐๐๐ถ๐ป๐ด in ๐๐ฎ๐ณ๐ธ๐ฎ is.
Kafka is an extremely important Distributed Messaging System to understand as other similar systems are borrowing fundamental concepts from it, last time we covered Reading Data.
Today we talk about At-Least Once and At-Most Once Processing. Why do you need to understand the concept and how it might impact your Stream Processing Application?
๐ฆ๐ผ๐บ๐ฒ ๐ฟ๐ฒ๐ณ๐ฟ๐ฒ๐๐ต๐ฒ๐ฟ๐:
โก๏ธ Data is stored in Topics that can be compared to tables in Databases.
โก๏ธ Messages in the Topics are called Records.
โก๏ธ Topics are composed of Partitions.
โก๏ธ Each Record has an offset assigned to it which denotes its place in the Partition.
โก๏ธ Clients reading Data from Kafka are called Consumers.
โก๏ธ Consumer Group is a logical collection of clients that read data from a Kafka Topic and share the state.
๐ฅ๐ฒ๐ฏ๐ฎ๐น๐ฎ๐ป๐ฐ๐ฒ:
โก๏ธ Consumers commit their state into a Kafka Topic named __consumer_offsets.
โก๏ธ State is denoted by an offset that a Consumer is currently reading at in a given Partition.
โก๏ธ There are different strategies when a commit happens. E.g. every n seconds, on-demand.
โก๏ธ If a Consumer fails or the Consumer Group is restarted, a rebalance will be initiated.
โก๏ธ New Consumers will launch and take the place of the old ones.
โก๏ธ Consumers start Reading Data from the last committed state per Partition.
There are different scenarios that can unfold when a Consumer restarts. Letโs take an easy example where you read data from Kafka, buffer it in memory and write a batch into an Object Storage.
๐๐-๐๐ฒ๐ฎ๐๐ ๐ข๐ป๐ฐ๐ฒ ๐ฃ๐ฟ๐ผ๐ฐ๐ฒ๐๐๐ถ๐ป๐ด:
โก๏ธ You set an offset commit strategy to on-demand.
1๏ธโฃ Read the entire batch.
2๏ธโฃ Serialize and write it into object storage.
3๏ธโฃ Wait for a successful write.
4๏ธโฃ Commit offsets.
โ๏ธIf Consumer fails before committing offsets after a successful Write new consumer will start from the last committed offset and writes duplicate Data to Object Storage.
โ This is usually ok for Batch Systems as deduplication is performed during ETL.
๐๐-๐ ๐ผ๐๐ ๐ข๐ป๐ฐ๐ฒ ๐ฃ๐ฟ๐ผ๐ฐ๐ฒ๐๐๐ถ๐ป๐ด:
โก๏ธ You commit offsets in small time intervals without waiting for a successful write to Object Storage.
โ๏ธIf Consumer fails before a successful Write into an Object Storage new consumer will start from the last committed offset and it will result in some Data not being processed.
โ This is usually ok for Logging Systems as losing small amounts of data does not affect the System in Critical ways.
Have you run into any problems with described behaviours? Let me know in the comment section ๐
--------
Follow me to upskill in #MLOps, #MachineLearning, #DataEngineering, #DataScience and overall #Data space.
Also hit ๐to stay notified about new content.
๐๐ผ๐ปโ๐ ๐ณ๐ผ๐ฟ๐ด๐ฒ๐ ๐๐ผ ๐น๐ถ๐ธ๐ฒ ๐, ๐๐ต๐ฎ๐ฟ๐ฒ ๐ฎ๐ป๐ฑ ๐ฐ๐ผ๐บ๐บ๐ฒ๐ป๐!
Join a growing community of Data Professionals by subscribing to my ๐ก๐ฒ๐๐๐น๐ฒ๐๐๐ฒ๐ฟ.
How to prevent child components from useless re-rendering in React.js?
An approach is to wrap your child components in React.useMemo().
#reactjs
Sign up to my newsletter to get more useful React.js tips: https://t.co/Eyno7ELwr0
Boost your web development knowledge and stay ahead with these 7 awesome newsletters ๐
1. Frontend Focus
https://t.co/uxIcJPKy1t
2. CSS Weekly
https://t.co/1VyllBBwMR
3. Javascript Weekly
https://t.co/Byi2tc4LOT
4. This Week In React
https://t.co/7gkStnd0OF
More ๐
I'm trying to compile a list of teacher conferences. What large conferences (at least 100 sessions) am I missing?
ISTE
CUE
NSTA
CEC
NAGC
Learning Forward
CAST
CMC South
CAMT
NCTM
Shape America
CAG
ACTFL
TESOL
ASCD
NCTE
NCSS
FETC