Reactive programming is cool for the kind of tasks you show in your presentation like CRUD operations. When it comes to projects where we have a very complex business domain, there are many different exceptions, rules, checks and so on reactive code becomes harder and harder to maintain. We have a situation where we have pipelines of 10 lines each with a Map/FlatMap for example. Not to mention how to diagnose the error in production or performance issue. I don't wish this on anyone. In summary, reactive programming is cool for easy applications, building data transfers but nothing more. Peace
how? if every function is total combining those will give a total function. To better understand performance pure functions can be compared to imperative style coding using local mutable state, ex. for-loops instead of recursion. And due to referential transparency different coding styles may be mixed as long as they stay pure and total.
If your machine cannot process data coming to it fast enough, then you use reactive to tell the data producer to slow down. Does that mean the data producer has some way to hold the data? Does that mean that instead of holding the data in our machine to gradually process it, we hold the data in the data producing machine to gradually release it? Does that mean we only move our issue from this machine to another machine?
The idea is to have an end-to-end reactive chain, where each part takes care of their responsibility, until the final publisher. So if you're using a mongodb reactive driver as the final publisher, it can take care of the "tough" job of how to handle backpressure, and the intermediate producers and consumers just have to take care of propagating it to the source. So the "issue" keeps getting propagated till it becomes mongodb's issue, which knows how to deal with it. (Disclaimer: This is a very simplistic view for the sake of a direction towards the answer.)
delayUntil subscribes to the inner code but returns the original item, which is the saved post from line 43 in this case. You can think of it like it's a procedure which executes its body, but then returns its argument (something like "Long myProc(Long arg) { return arg }"). That's why you can map this saved post into a Long using getId and return that ID as Mono.
Lord have mercy on those that have to read and maintain this kind of code, not to mention those that are new to this kind of project. Just horror and nightmares. Luckily there are other ways in the world.
Tomorrow Java 22 comes out with the 2nd preview version of “structured concurrency” where you can write blocking code with 1,000,000 virtual threads and clear stack traces. Then you can write obvious code that scales without it needing to use a reactive framework that must do complex things to juggle traditional threads.
What a showman 🙌🏼 I have never had this much fun with anything related to reactive programming!
Very well done presentation. Thank you.
The best talk about reactive programming that I had ever watched, with case by case.
Best video on reactive webflux
Impressive as it is, Virtual Threads make 99% of it obsolete.
Amazing talk. It helped me grasp some of the concepts of reactive i had not understood till now. Thanks!
Had almost given up on reactive until this guy showed up 👏👏
Love the way you teaches us!
This guy is a GOAT! Super helpful and informative.
Thanks for the awesome content and what an engaging and entertaining talk!!
Does anyone know what tool he is using to all the arrows?
Edit: It's ScreenBrush app for Mac.
Project Loom equivalent presentation would be interesting to compare 😇
Great performance and presentation style. I really enjoyed it!
Reactive programming is cool for the kind of tasks you show in your presentation like CRUD operations. When it comes to projects where we have a very complex business domain, there are many different exceptions, rules, checks and so on reactive code becomes harder and harder to maintain. We have a situation where we have pipelines of 10 lines each with a Map/FlatMap for example. Not to mention how to diagnose the error in production or performance issue. I don't wish this on anyone. In summary, reactive programming is cool for easy applications, building data transfers but nothing more. Peace
how? if every function is total combining those will give a total function. To better understand performance pure functions can be compared to imperative style coding using local mutable state, ex. for-loops instead of recursion. And due to referential transparency different coding styles may be mixed as long as they stay pure and total.
any chance sharing the repo?
Very good explanations and I really liked playing the right sounds at the right time 😂
1:39:31 i wasn't ready for it! xD
where can we find this repo?
If your machine cannot process data coming to it fast enough, then you use reactive to tell the data producer to slow down. Does that mean the data producer has some way to hold the data? Does that mean that instead of holding the data in our machine to gradually process it, we hold the data in the data producing machine to gradually release it? Does that mean we only move our issue from this machine to another machine?
The idea is to have an end-to-end reactive chain, where each part takes care of their responsibility, until the final publisher. So if you're using a mongodb reactive driver as the final publisher, it can take care of the "tough" job of how to handle backpressure, and the intermediate producers and consumers just have to take care of propagating it to the source. So the "issue" keeps getting propagated till it becomes mongodb's issue, which knows how to deal with it. (Disclaimer: This is a very simplistic view for the sake of a direction towards the answer.)
Ideally, the producers produce, the consumers consume. Typically there's a buffer in the middle ( databases, message queues, kafka topics, ... etc).
@@phanvanhoa if I'm getting data from a database, how can I tell the db to give me data slowly enough so that I can consume it without using reactive?
The Legend!
I have literally been through this whole learning curve with some folks how had not programmed in scala as I had. It was complete carnage 😂
1:50:50 isn't row 50 Mono too? why there is no need to add a return something there too?
delayUntil subscribes to the inner code but returns the original item, which is the saved post from line 43 in this case. You can think of it like it's a procedure which executes its body, but then returns its argument (something like "Long myProc(Long arg) { return arg }"). That's why you can map this saved post into a Long using getId and return that ID as Mono.
❤ superb!
Java 21, the Reactive webflux Killer?
amazing!!!
awesome
I can't believe I have to use this shit at work. 30 mins in and I already know I'm going to have to repeat parts of the video.
Lord have mercy on those that have to read and maintain this kind of code, not to mention those that are new to this kind of project. Just horror and nightmares. Luckily there are other ways in the world.
I have read and maintaining such application. What are the other ways you suggest ?
Tomorrow Java 22 comes out with the 2nd preview version of “structured concurrency” where you can write blocking code with 1,000,000 virtual threads and clear stack traces. Then you can write obvious code that scales without it needing to use a reactive framework that must do complex things to juggle traditional threads.