How Synchronous microservices talk to each other on cloud i.e AWS. Suppose there are 2 microservices A& B which are deployed on AWS ec2 instance. I cant hardcode B endpoint in A microservice. Bcz everytime Ec2 instance started , the IP gets changed.
Good question. Here you'll need some kind of a service discovery mechanism. There will need to be a tool which keeps track of which microservice is running on which ec2. A good way to do that in aws would be setting up an internal zone in route53 and writing some script which updates route53 whenever an ec2 server rotates. Or you could just use eks (k8s) to eliminate this problem all together.
What would subscribers do once they receive message payload from the publisher. Do you mean they store similar copy of the data maintain by the each Microservice and is that not add complexity ?
I'm not sure what's the use case you are referring to here. I'm assuming it is using CDC to maintain a near cache of the target database. Well, that's an interesting pattern especially useful when the time it takes to perform cross microservices joins isn't acceptable. So in this case we make a local copy of the data with other concerned databases so that thry can perform native db joins which is much faster. Now if you are wondering why make a copy when all microservices are most likely using the same database? Well, its because having microservices read from or write to tables of other microservices is an anti pattern and causes tons of problems. At the end, adopt new patterns into your system design only if you have a valid use case for it. Not every pattern would suit your needs. Being aware of what other folks have done to solve similar problems definitely helps. And that's the focus of this channel.
I have some questions. Pretend like we have api gateway microservice and user microservice. When user send get request to api microservice api gateway will send event and user service will capture it but how do we gonna return the response to user?
That's actually a great scenario. Usually an API gateway is considered to be "transparent" so there are no events being generated. However if you do want to go completely event driven, you can include the API gateway instance id as the source of the event. You can later use this id to send back a response to that particular api gateway. Your api gateway will hold the request till that happens.
Thanks for the EDA videos! They're really helpful. One thing I'm trying to understand is how to perform complex logic, like "only create a new product if the user has less than 10 products or is on a premium account"
Glad you liked it. Good question actually. The answer lies in creating an access control layer in front of our microservices. Its a simple read before write kind of a scenario. The real question however, is where and who will perform the read. I'll try to make a video to answer those questions soon. A short answer would be to implement an authorisation layer preferably in the api gateway itself. This engine will fire some rest calls based on rules you define and will decide whether or not to allow the write (add new product) based on the response of those calls. The project I'm working on does precisely this: docs.space-cloud.io/security/how-it-works/
@@YourTechBudCodes awesome thank you so much for your reply! The way you're so passionate and giving detailed responses is so heart warming :) One approach I'm looking into now is the saga pattern. I think it may be a good solution to it, but of course has it's tradeoffs, like removing isolation in a way
Haha. Thanks. I really enjoy making these videos and sharing the lil bit of experience that i have. If I remember correctly, saga is for distributed transactions. A distributed transaction (especially the saga pattern) may be an overkill for the use case you shared. Have a look at my video on basics of event driven communication. I talk about how you can solve the distributed transaction problem in a decoupled manner.
Absolutely. Is there anything particular in mind that you would want me to cover? I was thinking of making a series right from "How to get started with microservices?"
@@YourTechBudCodes You're welcome! I've just subscribed! I only saw this video, and I've yet to lurk on your channel, but I'll ask anyways lol: have you ever covered deployments with CD/CI and scaling stuff? That would be a super interesting topic for me
This is a fairly new channel (only 3 videos old). CI/CD using popular tools, K8s, Monitoring and alerts are all part of the roadmap. I'll make video on introduction to devops and CI/CD in a week or two for you. ;)
Short, sweet, and VERY informative. Loved the mad uncle example!
Haha! Seems like you can relate with it strongly.
How Synchronous microservices talk to each other on cloud i.e AWS. Suppose there are 2 microservices A& B which are deployed on AWS ec2 instance. I cant hardcode B endpoint in A microservice. Bcz everytime Ec2 instance started , the IP gets changed.
Good question. Here you'll need some kind of a service discovery mechanism. There will need to be a tool which keeps track of which microservice is running on which ec2. A good way to do that in aws would be setting up an internal zone in route53 and writing some script which updates route53 whenever an ec2 server rotates.
Or you could just use eks (k8s) to eliminate this problem all together.
What would subscribers do once they receive message payload from the publisher. Do you mean they store similar copy of the data maintain by the each Microservice and is that not add complexity ?
I'm not sure what's the use case you are referring to here. I'm assuming it is using CDC to maintain a near cache of the target database.
Well, that's an interesting pattern especially useful when the time it takes to perform cross microservices joins isn't acceptable. So in this case we make a local copy of the data with other concerned databases so that thry can perform native db joins which is much faster.
Now if you are wondering why make a copy when all microservices are most likely using the same database? Well, its because having microservices read from or write to tables of other microservices is an anti pattern and causes tons of problems.
At the end, adopt new patterns into your system design only if you have a valid use case for it. Not every pattern would suit your needs. Being aware of what other folks have done to solve similar problems definitely helps. And that's the focus of this channel.
Finally a good explanation that is well put together and not boring as hell
Glad you liked it
I have some questions.
Pretend like we have api gateway microservice and user microservice. When user send get request to api microservice api gateway will send event and user service will capture it but how do we gonna return the response to user?
That's actually a great scenario. Usually an API gateway is considered to be "transparent" so there are no events being generated.
However if you do want to go completely event driven, you can include the API gateway instance id as the source of the event. You can later use this id to send back a response to that particular api gateway. Your api gateway will hold the request till that happens.
Thanks for the EDA videos! They're really helpful.
One thing I'm trying to understand is how to perform complex logic, like "only create a new product if the user has less than 10 products or is on a premium account"
Glad you liked it.
Good question actually. The answer lies in creating an access control layer in front of our microservices. Its a simple read before write kind of a scenario. The real question however, is where and who will perform the read.
I'll try to make a video to answer those questions soon. A short answer would be to implement an authorisation layer preferably in the api gateway itself. This engine will fire some rest calls based on rules you define and will decide whether or not to allow the write (add new product) based on the response of those calls.
The project I'm working on does precisely this: docs.space-cloud.io/security/how-it-works/
@@YourTechBudCodes awesome thank you so much for your reply! The way you're so passionate and giving detailed responses is so heart warming :)
One approach I'm looking into now is the saga pattern. I think it may be a good solution to it, but of course has it's tradeoffs, like removing isolation in a way
Haha. Thanks. I really enjoy making these videos and sharing the lil bit of experience that i have.
If I remember correctly, saga is for distributed transactions. A distributed transaction (especially the saga pattern) may be an overkill for the use case you shared.
Have a look at my video on basics of event driven communication. I talk about how you can solve the distributed transaction problem in a decoupled manner.
You are pretty good at delivering information, great video!
Thanks buddy. Just want I needed to hear to keep going!
Awesome .. well exlained !! Keep up the good work !!
Thanks! Means a lot!
Very high quality content! Thank you for this overview
Thanks a ton!
So nicely put together, Awesome! Keep rocking!
Thanks buddy! Glad you liked it!
Simply awesome and very informative !!!
Glad it helped!
Excellent presentation. accurate examples. you just earned a life time subscriber.! 4:16 waiting for the GraphQL video.
Thanks a ton. Really appreciate it!
Could you please make the Microservices tutorial series
Absolutely. Is there anything particular in mind that you would want me to cover?
I was thinking of making a series right from "How to get started with microservices?"
@@YourTechBudCodes thank you for your response, it should be a practiced videos which make more attractive
Got it. Will try to include more hands on videos from now!
Fantastic explanation. Great
Thanks. Do subscribe for more!
Nice one, mate! Really interesting, made me really curious on microservices. Thank you for the video!
Means a lot. This is exactly what keeps me going!
Planning to make an entire series on Microservices! Stay tuned and do subscribe!
@@YourTechBudCodes You're welcome! I've just subscribed! I only saw this video, and I've yet to lurk on your channel, but I'll ask anyways lol: have you ever covered deployments with CD/CI and scaling stuff? That would be a super interesting topic for me
This is a fairly new channel (only 3 videos old).
CI/CD using popular tools, K8s, Monitoring and alerts are all part of the roadmap.
I'll make video on introduction to devops and CI/CD in a week or two for you. ;)
Just made a video live on what DevOps is. You might like it...
ruclips.net/video/yczwWzkbFAQ/видео.html
Very well put together content, Really helpful! Thank you!
Thanks!
Keep going hero , informative video thank you
Glad you loved it
Your great at explaining stuff. 😂😂 🎉🎉
Glad you liked it!
Amazing video 💯 very well thought out 👌
Thanks buddy!
Well explained!
Glad you liked it
Good content! ❤️
Thanks!
Thanks a lot for this amazing explanation. Please keep it up, bro
Glad you liked it
Great video actually, thaks
Glad you liked it!
u r brilliant bro :)
Thanks a ton buddy
@@YourTechBudCodes you saved my interview today. Never gonna forget you. This channel deserves all respect.
Glad I could be helpful.
well explained :)
Thanks
Well explained.
Thanks!
Awesome sir!
Thanks buddy
Very good communication
I see what you did there 😂
Your WhatsApp analogy made me laugh. :D
It's pretty legit isn't it?
@@YourTechBudCodes Yes it is.
Wait...how do you know about my uncle!
Haha. That shall remain a mystery!
if you do less acting and focus more on content.
I'm afraid that is not possible... sorry about that