My apologies if this is the wrong stack exchange site for this question. Please, let me know if I should ask this in a different place.
I have recently went to a interview. The interview was for the position of senior full stack engineer. At that interview, I was asked the question:
How would you design a scalable web application
While the question focused on scalability, it was meant in the sense of a modern, responsive application.
I will try to reproduce the answer I gave as best as possible.
I was told that my answer, while it have some good points, was not exactly what they would expect, and that it was closer to the answer they would expect from someone applying for a mid level position rather then a senior one.
I am curious how my answer can be improved.
Well, there are three things to consider, the frontend, the backend and the data base. Since I am mainly experienced with React, Django and MongoDB, I will assume these technologies.
Moving to the backend, we would have a RESTful architecture. Our Django views would be mapped to different methods and endpoints and their role would be to communicate with the data base. I would use mongoengine rather then the lower level pymongo. We couldn't have only one server so I would deploy this under a load balancer. Another thing I would ensure is we serve everything over https. I would redirect all http traffic to https, in order to improve security.
Coming to the database, we would need a cluster, in order to be able to scale horizontally. In order to optimise performance I would index the database. Additionally, I would ensure we had different machines used for reading and writing, in order to distribute the load more evenly.
What are the most important things to mention when it comes to scaling regarding each of the three components of the stack?
Other then scaling, what are the other features of modern web application?
What is a complete and thorough answer to this question?