MICROSERVICES ARCHITECTURE | SERVICE MESH | PART - 9

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video let's learn what is serviced mesh in previous videos we actually learned what is inter service communications right so it is really necessary for two or more micro services to talk to each other to update the data our query the data or to make so many things so there are a lot of challenges in you know when we are talking from one service to another services we learned what is the difference between a synchronous and synchronous communication but we didn't really understand what are the challenges you know what are the different use cases we need to handle when we are communicating between micro services say for example consider this is like 1 2 3 4 different micro services they have multiple instances of services running right maybe the the fourth one is only one so how do we basically when we are talking from one micro service to another micro services how do we actually do the load balancing which specific instance we are connecting maybe like we understood that we can use our PC or rest yih people I consider we are doing where it should appear best now if we are talking from if you are making a call from micro service one tomato service tool we know that there are two instances of micro services to which one we are going to connect and what is the IP address and the port to which we need to connect we also understood that service discovery are so this registry will actually have the latest network addresses so for all of the micro services right but we need to query the service registry first and then out of which we need to select one and then we have to make a query that's how we basically do the load balancing and for the load balancing we'll have to choose some strategy either random who is going to do all of that it's not just one services problem the same problem actually occurs in every services where it is making a call right because the same thing happens here as well in the micro service - we need to get the service registry for this is micro service this is micro service and that also we need to balance lower balance that so these are the two problems right we had to do the load balancing we had to get this we had to discover where is the service and also metrics collecting the metrics is also grown saying if for example we are making a call to from one Microsoft or another and this to this we have to get some insights of what is the response time what is the request time and how many were failed how many were passed in total how many requests we are making between services out of that who is going to collect all of this information maybe we can log from every Mike response to some log file and then we have to do further processing to get that or we can build sophisticated systems where we can actually in real time see how many calls are happening there any 500 sort form rates for that also we need to have a system which actually collects all of this metric metrics like and who is going to do that and also retrace for example now say for example I'm making a call from one to two if the service is failing I will may be considered to recharge we also learnt that circuit breaking concept right so who will do that circuit breaking and also who will make sure we re trying to check if that service is running or not maybe just check once or say if I make a call from micro service 1 to 2 and if micro service to is not responding even after 2 to 3 minutes it doesn't mean that we have to keep waiting until micro service to closes the connection we have to have a timeout right who is going to set that timeout what if the developer forgets to set the timeout when he is making a call from makers as one two or maybe 2 to 3 there should be some one you know place where we can configure you know a standard timeout to all of these you know interactions between micro services so where can we do that and yeah so that retries timeout and circuit breaking so who is going to do all of that and definitely developers should do that but the same problems occurs in every micro services where Microsoft is making a call and it's definitely not advice to implement that everywhere so that's where this service mesh comes and comes in and solves all of the problem so service mesh is one more component which actually runs along with every micro service deployment and helps to do all of these say these are it looks for example as you can think it as a VM you know doctor pod or container or whatever you want to okay so when we deploy the Microsoft this server is running we have to deploy my you know service mesh also if we have 10 different micro services or 10 instances of micro services there will be 10 instances of service mesh which is running parallel to the same micro service for every micro service so this basically it is a pattern called as a sidecar pattern so if you have read about different design patterns then sidecar is one pattern which service mesh implements that means that for every micro service instance they will be our instance of service mesh which is running in that VM pod or container what it does is it actually helps to solve all of this problem ok and one more thing you need to understand is this also implements proxy design pattern you don't know the proxy but just for the sake of beginners I'm just gonna explain the proxy proxy is thinking like a you know agent or a mediator right say for example in a lot of companies they implement proxy for browsing the internet say if they want to limit or block some of the sites what they do is they have a company-wide proxy every desktop or laptop basically cost grouses all the web sites or the Internet through this proxy when you actually browse youtube.com the request actually goes to proxy and proxy is the one which actually makes the quality YouTube server and gets back so if your company doesn't really want to allow and youtube.com to be accessed then they can just block it here and show the error page of our login page to be logged in by only specific people in the company to access that channel or anything so there are so many other things you can do in the proxy basically sits in between the source and the destination or between two parties and will I exchange the information in the same format or the same protocol so that's that's the same thing here as well so this mesh actually acts as a proxy between different microservices so how it works how service mesh works is whenever whenever a micro service actually makes a call to my you know Microsoft's - as I mentioned so this is service much and this is our micro service actual server okay we actually make a call to this service using service mesh and surface mesh actually makes a call to micro services micro service - so that way we don't need to in our code we don't need to really you know do the service registry first to identify what is the IP address and hostname to talk to those micro service - ah we don't need to really worry about load balancing even though there are hundred instance of microcells - we don't need to really worry about that at all or we don't need to worry about so the statistic or we don't need to log the metrics as well like we don't need time any like when the requests started and when it ended we don't really do that you just need to call it simple like request start get that's all the metrics will be calculated by this service mesh and then it collects it and then it sends everything to one specific component which is also deployed along with the service mesh to collect all the metrics say every service measures here if they are making any requests further they are all actually sending all the metrics back to the matrix server so you actually have all the you know metrics available in this you know metrics server to be seen in real similarly when microphone is - is actually wants to talk to make a call to make sure it's four or three we actually use this service mesh as a proxy and then make a call to my service 304 so that way the service much actually provides all of this features by default takes care of I'm out we can set the timeout and after that timeout the service service mission basically automatically closes the connection and returns back whatever error response it uh also implements circuit breaking so it is some services are failing as we learned from the previous video it has all the things you can configure fallback we can configure cache whatever the circuit breaking feature supports it also actually handles repriced as well if you want to really set a retry mechanism okay if once if I get you know error code for first time maybe try once more and then implement the circuit breaking so all these possibilities is possible without even implementing without even worrying about all of this information so basically we get the same reliability reliable connection between every micro services and we get all of these features by implementing service mesh instead we switch there are two major components the first one is data plane and the second one is control plane the control plane is the centralized hub or a single hub which acts like a control panel from which you can actually configure configuration for all of the proxies which are actually side loaded along with every micro service running in every instance the second one second major component is data plane the data plane is a group of all of these proxies basically the important interesting thing is these proxies doesn't know the existence of other proxies in the same cluster they basically work in finicky so using control plane we basically provide all of the configuration to these individual proxies so the proxies know how to behave basically proxies are the one which actually does the load balancing service discovery metrics retries and timeout the requests and etc basically the data plane is comprised of proxies and all of the requests actually goes through these proxies so you can say all of the requests are actually happening in data plane the control plane is actually the one which actually controls all of these proxies and provides the configurations and settings
Info
Channel: Tech Dummies Narendra L
Views: 21,859
Rating: 4.9793816 out of 5
Keywords: Amazon interview question, interview preparations, software interview preparation, developer interview questions, Facebook interview question, google interview question, Technical interview question, software architecture, system design, learn System design, MICROSERVICE, learn microservices, introduction to microservices, advanced microservices, microservice architecture, microservices system design questions, advantages of microservices, service mesh
Id: q-EkBbfuiAo
Channel Id: undefined
Length: 11min 43sec (703 seconds)
Published: Fri Mar 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.