0

I have react JS as my client side framework and Node JS express is my API backend services with SQL database on a home project. The app runs locally on my machine and I want to deploy the app in azure. I am not sure if I have to take 2 app services instances to manage my frontend and backend or take a linux VM and manage the deployment myself as I am doing now locally with nginx and pm2.

Considering scalability in future, how to deploy in Azure and what I have to take as Azure components?

James Z
  • 12,209
  • 10
  • 24
  • 44
Raghavendra Prasad
  • 649
  • 1
  • 5
  • 12

1 Answers1

0

I'm assuming you are using the free tier for learning purpose as you said it is a home project?

For scalability and availability, I would go with a 3-tier architecture, the first tire is for the compute stuff (the nodejs app), deployed in an auto scalling group of minimum two instances all behind an Azure load balancer

The second-tier is the DB, I would go for Azure Databases for this

And last, is your React app, if it is a statically generated app (like Gatsby), I would go for Static website hosting in Azure Storage, otherwise it is best to put the React server in the same Linux instance as Nodejs app, and use path redirection in the load balancer to target the App

PS: this will cost a considerable amount of money depending on the load, but you don't have to care about the scalability, also you don't need to manage your database anymore.

ZEE
  • 5,669
  • 4
  • 35
  • 53
  • Thank you for getting back on this so quickly. My react app has data coming from db and it is not static and user role specific . So should I go with app services or VM's for my nodejs and reactjs? – Raghavendra Prasad Aug 11 '20 at 13:16
  • Yes you can use the same VM for node and react, and reverse proxy queries based on url with ngnix, something like clien.site.com and api.site.com, dokku can help you manage this in the VM level, and then you put everthing in an autoscalling group behind and LB – ZEE Aug 11 '20 at 14:01
  • http://dokku.viewdocs.io/dokku/ very easy to use and will help you save hours deploying you own solution (manages ngnix and containers for you, as well as 0 downtime when you push a new version of your app) – ZEE Aug 11 '20 at 14:04