Web service in the cloud
When a user visits your service, you need to send an HTML document with the service’s interface to the user’s browser or WebView. The frontend server is responsible for generating and sending HTML. This is usually a Node.js application, but in the simplest cases it may also contain a static web page.
If the service does not require significant business logic, you can implement it on the same server. Otherwise, it is better to dedicate a separate backend server for processing data and sending it to the frontend, for example, in JSON format. Data transfer between the client, frontend, and backend servers must be distributed by load balancers. You can use software load balancers such as HAProxy, nginx, or other solutions.
It is most effective to keep user files and static web pages in S3-compatible object storage. This is a fault-tolerant option that provides continuous access to files with direct links. Database management can be implemented on one of the backend server VMs, but it is better to use a cloud database management service so you don’t have to maintain and update the DBMS.