Create a Bank Account System with Kafka Streams - Stateful Processing

  Рет қаралды 11,459

Programming with Mati

Programming with Mati

Күн бұрын

Kafka Streams is well prepared to handle stateful processing of streaming data. It has abstractions, operations and heavy lifting to help us in this difficult task.
In this tutorial we are going to build a Bank Account system to process live transactions and update the balance of each user.
---
Follow me:
Twitter: / progwithmati
LinkedIn: / matiasdsalerno
GitHub: github.com/Programming-with-M...
---
Sections:
00:00 - Intro
00:28 - Why stateful processing?
01:32 - State Stores in Kafka Streams
03-01 - KTable
03:32 - Stream/Table Duality
04:14 - Introducing our tutorial
06:01 - Browsing the source code
09:25 - Implementing the Topology
10:39 - Topology: Aggregate Operation
17:01 - Implementing the Process Transaction method
22:52 - Run application
25:50 - Outro, next episode...
---
Links:
GitHub repository: github.com/Programming-with-M...
Previous tutorials can be found in the GitHub page: programming-with-mati.github....

Пікірлер: 17
@TriggerrSupernova
@TriggerrSupernova 7 ай бұрын
As a beginner to Kafka streams I found the explanation really clear. Great explanation Mati Thanks.
@twodots1990
@twodots1990 Жыл бұрын
Awesome explanation 👏
@pedrocorreia5857
@pedrocorreia5857 Жыл бұрын
Thank you for the information, there really isn't much quality info about streams online so once again thank you and keep up the good work!!!
@programmingwithmati
@programmingwithmati Жыл бұрын
Thanks Pedro! I'm glad it was helpful to you
@rupeshjha02
@rupeshjha02 2 жыл бұрын
Good explanation and well organized videos. Looking forward for more such videos.
@programmingwithmati
@programmingwithmati 2 жыл бұрын
Thanks for the feedback! Really appreciated! More videos are on the way!
@ayyoubtelmoudy574
@ayyoubtelmoudy574 11 ай бұрын
I miss the words to describe you ,so thank you so much ❤
@programmingwithmati
@programmingwithmati 11 ай бұрын
You are welcome! Thanks for the kind comment!
@thesadanand6599
@thesadanand6599 Жыл бұрын
Great Work, There are very few doing playlists on kafka-streams end-to-end. would have been great, if you could have picked some easier short examples to help out begineers.
@programmingwithmati
@programmingwithmati Жыл бұрын
Thanks for your kind comments and your feedback!
@iliapetrov1743
@iliapetrov1743 2 жыл бұрын
Hi Mati! Thanks once again for your videos! Could you please create any example of using Kafka as an interaction system among micro services if possible?)
@programmingwithmati
@programmingwithmati 2 жыл бұрын
I will! Currently I’m preparing a video on how to scale a stateful application, which is taking me longer than I expected! Thanks for the feedback!
@eybertalexis
@eybertalexis 7 ай бұрын
Where is the console-consumer script file?
@pritamshirbhate6801
@pritamshirbhate6801 2 жыл бұрын
nice explanation. how can we store the bank balances into the redis db using state store, so that we can fetch it whenever required?
@programmingwithmati
@programmingwithmati 2 жыл бұрын
Hi Pritam, thanks for the comment! I haven’t seen an implementation of stateStore with Redis. So, as far as I know, you’ll have to create your own implementation, which you can absolutely do! You can probably look in the internet if someone created an implementation already.
@wangfred
@wangfred Жыл бұрын
Hi Mati, great content! I really appreciated your work. I have three questions: 1. noticed in BankBalanceTopology when filter by state==rejected, looks like the stream is's split to two branches, can you explain why we don't nee split().branch() here? 2. when you declare the rejected stream, how does it know which point of the stream it plugs in? this case, look like the order to declare the balance topic and rejected topic doesn't matter. 3. in the second test case, I understand the first balance is 0 and second one is 3000. But for the third one, it should be 3500, why it is 500?
@marquardtsnell7916
@marquardtsnell7916 8 ай бұрын
Oh boy, a test! I think I got this: 1. split().branch() would create an either/or condition. We still want to send the rejected transactions to the "bank-balances" topic, it's used for the **latestTransaction** field. So, we always send to "bank-balances" topic, but if it's rejected, we *also* send to "rejected-transactions" topic. 2. because of the first answer, you're correct. Once we have enough information to determine the value of the state (after deserialization), we can filter and send in any order. Think of sending to the "bank-balances" topic and filter/send to the "rejected-transactions" as parallel operations. You can do them in either order. 3. Notice the balanceIDs. In the first (-500) and third (+500) transactions, the balance Id is 1. In the second transaction (+3000) the balance Id is 2. The balance Ids are like account numbers, that's how we keep everyone's accounts separate. The transition happens in BankBalance, the BankBalance.id = bankTransaction.balanceId, then in the topology, the transactions are .groupByKey() and aggregated *by those keys*. Keeping balanceId#2's account safely away from balanceId#1!
Create a REST API with Spring Boot for our Kafka Streams Bank Application!
21:50
Time Window Aggregations in Kafka Streams!
23:25
Programming with Mati
Рет қаралды 7 М.
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 45 МЛН
Получилось у Миланы?😂
00:13
ХАБИБ
Рет қаралды 3,7 МЛН
Как бесплатно замутить iphone 15 pro max
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 7 МЛН
"EoS in Kafka: Listen up, I will only say this once!" by Jason Gustafson
42:55
Strange Loop Conference
Рет қаралды 10 М.
Kafka Streams: Zero to Hero - Ep 2 - Stateless Processing - Part 1
33:05
Programming with Mati
Рет қаралды 8 М.
Kafka Stream Processor Api implementation with Spring Boot | Stateless Operations
30:13
System Design: Why is Kafka fast?
5:02
ByteByteGo
Рет қаралды 1 МЛН
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 28 МЛН
Какой ноутбук взять для учёбы? #msi #rtx4090 #laptop #юмор #игровой #apple #shorts
0:18
Это - iPhone 16 и вот что надо знать...
17:20
Overtake lab
Рет қаралды 138 М.
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
VA-PC
Рет қаралды 2,5 МЛН