Designing a backend service
To design our backend service, we are going to use a variation of an existing architectural pattern called model–view–controller (MVC) pattern. The MVC pattern consists of the following parts:
- Model: Handles data and basic data logic
- Controller: Controls how data is processed and displayed
- View: Displays the current state
In traditional full-stack applications, the backend would render and display the frontend completely, and an interaction would usually require a full-page refresh. The MVC architecture was designed mainly for such applications. However, in modern applications, the frontend is usually interactive and rendered in the backend only through server-side rendering. In modern applications, we thus often distinguish between the actual backend service(s) and the backend for frontend (which handles static site generation and server-side rendering):
Figure 3.1 – A modern full-stack...