
Senior Software Engineer
Mfiflex TechnologiesSoftware Engineer
Cast Software IndiaSenior Engineer
Samsung R&D InstituteTechnology Analyst
Infosys
Git
Jira
.png)
Docker
REST API
Could you help me understand more about? Yeah. Sure. So, I have been working. I'll start with my brief introduction. So, my name is Aditras. Currently, I'm working as a software engineer at Cast Software. So, I'm part of the research and development team here. I basically develop applications, whether it's related to Java, Python.NET, or any kind of application, including Android. What we do is develop and document the APIs. We support new APIs and provide the main features. Before deployment, we also do non-regression testing to ensure the older features are not affected by the new feature. And, also, there is integration testing before any test or deploying the code. It helps in providing a new feature to be ready for production. We also have discussions over any feature we have to upload or release. So, yeah, as I said, I have around 6 years of experience now in back-end engineering. My career started with Infosys. I worked there for around 3.5 years. And there, I worked for a client based out of the US, and it was a logistics project. I had to deal with APIs where all the consignments were okay, and the data was fine. I started with basic bug fixing, then moved to development. I was promoted from a system engineer to technology analyst. Then I moved to Samsung R&D Institute, Bangalore, for only 6 months. There, I worked on a camera system project. It was an embedded project where I used C++ and a lot of embedded things. Currently, I'm working as a software engineer at Cast Software. The work is good, but the learning opportunity is not good. That's why I'm thinking of changing. And, yeah. That's pretty much from my background. I'm a computer science pass-out from 2/4/18, from the Institute of Management Technologies in Calcutta. I passed out and studied there. So, yeah, this is a brief introduction of myself. Thank you.
What's the difference between a view, a view set, and model view set. So it's one of the concepts in Django framework where we have a concept of view that allows you to combine the logics for the set related to the views, a single class or a view set. So what it helps in is that it helps in not having repeated functionality that can be combined into a single class. And this is what I'm talking about, the view set view set, where all the routers are used to write the URLs configuration. So we do not need to write URLs configured externally. So this is one of the advantages of viewset. Which would you build? Yeah. I basically would use a viewset here because there might be different use cases. But if we have to combine different sets of classes, then a view set will be one of the beneficial things to do. And yeah, the CRUDs all the CRUDs are basically implemented. We can implement the CRUD APIs in the view set. And accordingly, we can also serialize that in the Django rest framework. If I talk about model view set, it's also a part of Django REST framework, which is DRF. And it's a class-based view that provides a set of default actions for performing CRUD. CRUD elements create, retrieve, update operations in a model. And yeah. Obviously, model view set includes actions for listing, creating objects, as well as retrieving, updating, and deleting the individual objects of the class. Model view set inherits from the generic view set. There is a generic view set in DRF and includes implementation of the basic rights actions using the appropriate serializer and model. And usage is by subclassing it and specifying the serializer and class is used. So this is one of the major implementations of this. So yeah, this is how I can come up with the difference between model view set and view set and views. So these are all types of models in Django REST framework. And I just said I'll basically use I have mostly used view set here for the rest API endpoints because it's easy to maintain, and it is separate from each endpoints. So yeah, that is the main reason which I use view set here. Thank you.
What is the difference between select related and if it's related, where is in Django. So what I can see is, Django REST framework is a very powerful ORM, where in the models, we have different types of query sets used. So what I can say is, we have query sets in Django rest framework and we have different query sets in which we have selected, it says star fields, it selects all the fields from the method and the method returns the query set that will follow the foreign key relationship. Selecting the additional related objects data means it executes its query. For example, if we have 2 tables which are connected with each other and if we use a select related query set, then it brings all the data from the particular table. And this is a performance booster that results in a single more complex query, but later use a foreign key or 1 to 1 relationship, which will not require additional database hits. Right? So this is one of the select related queries which I can think of. We can also optimize the above query, means the queries which are being used and reduce the number of database hits. So this is the main purpose of select related queries, and it takes the string related first attribute means in, we have like for example, we have a blog, and we have to return the all the columns which are string based. So this is one of the things. And prefetch related is something like a lookup thing where, it returns a query set that will automatically retrieve in a single batch means, and related object from each specified lookup. So we have lookups there, and we can also fetch and retrieve all the single in a single batch using the prefetch related queries. this is this is similar to the purpose of select related, but both are designed to stop the database queries caused by accessing the related app, but they are quite different. So select query works by creating an inner join and includes fields of related objects, select statement. And, prefetch is related to multiple instances of related objects through a combination of database queries and in-memory processing. So this is the main difference, and it fetches the main objects within single query. Means, I am talking about prefetch. It fetches the main objects within single query. And we have also additional features, which helps in minimizing the number of database round trips. So yeah. And as I said, it's also helps in-memory processing. So, this is the main thing which I can think about. I'll talk about the relationship. Prefetch is related for optimizing queries involving reverse relationship. For example, foreign key, 1 to 1 field or many to many field. But how select related queries are used to optimize the queries involving forward relationship that is foreign key fields on the current model. If I talk about number of queries, prefetch can still result in multiple queries, but in select, it reduces the number of queries to 1. That's the main difference between these 2, select related and prefetch. Yeah. That's one of the case. Thank you.