Specilist Engineer
LTIMindtreeSoftware Development Engineer (Full Stack)
Tata Consultancy ServicesSoftware Development Engineer (Frontend)
Opalina TechnologyFrontend Engineer
LynkitVSCode
Jira
snyk
Eclipse
Hi. My name is Adil. And I'm from of India. And, now, I last 5 year, I am living in Delhi and, working in a React site and JavaScript sites actually, my tech stack is 1, 1st tech. Okay? And here, I'm working TCS to manage the client So applications which is, use technology React and Node, MongoDB. So I'm working on that. So, basically, basically, my domain is a pharmaceutical. So I'm working for pharmaceutical domain. So so, this is my introduction. So Thanks.
For monitor, we can, we can use, Node. Js for we can print the, paper trail to logging and, use For longer my time, so we'll stand in And save the database for everything. And, for performance for performance, we write, the list called e a 6 way back end services on the, you know, the structure way to performance of notice, and we we write a sync way to, any
How do you ensure that your components are using different project? Ensure that your components are these are visible. And so the idea of the components are visible across different points. Uh, when we write component in real JS, so we write, uh, in a way, like, uh, my state component is different and the stateless component is different so that we can pass the data from 1 component to another component. So suppose there's a form component or there's some UI, uh, UI component. So we just change, uh, so what we have created button component. So we'll use the button entire my application. So we, uh, pass as a prop for styling or some width. So so this way, we can use the component entire my application, button component, or any, um, filled, uh, fill components. So in this way in this way, we can use
For for improve the load time, we can you we can implement the lazy load in the ideas. So yeah. We can use the lazy load components, and, uh, you know, uh, we we can use the we can use the, uh, suppose we are, uh, when my website is is load, so there are different different components. So every components, we can, uh, separate call from header, separate call body, separate call. Sidebar, there's a different call. So we can use a async way in that way. So every components, uh, face the data from back end, uh, individual, and that rerender the screen for, uh, not a one time. There are some different timing. The will later come first and after just a fraction second sidebar in the body. So in this way so a synced way we can, uh, use the thing.
So SQL injections, uh, when when we post any, uh, when we post any when we use any post method or any from postman to Node. Js, and so we first of all, we check the validate data from suppose, uh, there was a 2 field in a number and, uh, email. So must be number field, must be type of number, and emails email email field such with that email checker. Okay. We can use a validate checker so that we can verify the length of this, uh, fit length length of the variable so that we can not give the limit of the, uh, you can pass any string, any long string. Any okay. So in this way, we can, uh, we can reduce the SQL injection. Okay. We can check the length, type, and, uh, not just, uh, put a raw data inside the MySQL. We have to check. We have to implement a middleware here. So we have to check every field. Every field. Not uh, not just blindly, uh, put the raw data coming from front end to inside the database. So so this way, we can, uh, prevent these SQL injections. We can check also there's another script from coming from the any field from the UI side. So we had to check this thing.
For this, uh, suppose my MongoDB connection is getting dropped or not, uh, not actives, MongoDB connection. So that time, uh, we can get a 500 error. If my, uh, try catch is throw an error, uh, this might be some misconfiguration of the user model or we, you know, pass the parents as the IDs we we are passing, you know, as the ID, uh, from UI, just, uh, get the user. And, uh, so this way, my try my try block get, uh, fail, then we reach out to, uh, then my call go to catch block, and they will send a 500 error. So this way, we can, uh, so we'll get to 500 error.
Here, uh, suppose if you do not provide any ID, file update the user, then we go then we get an error means, uh, okay, then we fall the when we not provide any email and we just check, uh, put the request, then we got an email is required. So we necessarily, we have the ID in params and body. We have applied to email so that it will work. And, uh, if, uh, if this email is not and if the ID is not put in my database, if the ID is not put in database, then we simply, uh, not user not found. So so in the line here, if user not found, then we not update the, uh, find by ID and update. It will not work if the user is not found in my database. So this way, it might get wrong if, uh, the ID is not found in my database because we I'm going to update find by ID and update. And if ID is not a percent, then we go go wrong here. So we can ensure that here, um, ID must be this ID is present in my database, then we, uh, then we have to update this, uh, yeah, this try try block code. Then this code will work. Must be present their user ID. So here, this part get wrong, uh, if not user not found. We ensure that, uh, before we we find by ID and update, uh, this line, we can also write a one line above, Find by ID. 1st, find by ID. 1st, if ID is found, then we, uh, go to update. If ID not found, then simply, uh, send the user not found. So this line, we can write in 2 line.
For scaling a moment, we database, uh, we can use we can use for scaling database, we can use, uh, MongoDB cluster to, uh, use multiple replica, say, sarding. We so we can use the sarding and multiple, uh, replica, say, to to use the scale, the MongoDB. MongoDB minimum, we can, um, amend a 3 node of the MongoDB, uh, uh, to for scale the applications. 3 node, at least 3 cluster we can use.
Yeah. When we do try to, uh, you know, when when when we don't try to organize the components or, uh, we not check the rerendering happens, so they can then we can lose from bottleneck because and suppose we are writing and we don't suppose we are using a useEffect hook and we not pass an array, then my then this component is in the in frankly, then it's, uh, after my application getting crashed. So we had to check we had to write when write hooks in a hooks API and, like, when we write a very, um, clear way and recheck again when we write this thing.
We can write us, uh, we can write a small small functional component and then win together to add, uh, in a one component for, uh, for, uh, so that we can reduce the class component to functional component. So so if for a class component, uh, there are the multiples responsibility, then we can simply reduce the compose complexity into small small React, react funds or components. So in this way, we can use this.