I have developed an application using AngularJS + NodeJS (together with MariaDB, Redis and Socket.io for realtime notifications) and I have deployed it on a single Linode node. Now I would like to organize the architecture in a way I can easily scale the application in case of traffic increases in the future.
So my idea is to prepare everything as follow:
- 1 Linode LoadBalancer server that will be the main point and will redirect the requestes coming from the users
- 1 Linode node server where I will install Nginx that, acting as a reverse proxy, redirects to the NodeJS server in the same node
- 1 Linode node server for MariaDB and Redis server
so when I need to scale I add a new node with Nginx + NodeJS. For MariaDB + Redis I would set the clustering for both (I use Redis for the session and MariaDB for the data).
Now my doubts are the following:
what would be the proper architecture for the application?
where should I put the AngularJS app, on the LoadBalancer or on each node?
do I need nginx acting as reverse proxy on each node?
Thank you!