Reputation: 183
I have a full-stack node.js project and I don't know what the best practice is for deploying it.
some information first: the app consists of:
the deployment shouldn't cost too much because it's a hobby project.
Currently (as dev env) I use vercel for the frontend and my own vm for the backend
However, I would like to deploy everything in e.g. an app engine (i.e. without much config and with automatic scaling)
I just don't know what the best provider is, because there are many services, e.g. gcp cloud run, gcp app engine standart, app engine flex, firebase hosting, gcp cloud computing, all aws services, and many more...
I would prefer docker-compose, for example, on the google cloud platform with all the advantages of app-engine/cloud run, i.e. little config, automatic scaling and not too expensive, since it's just a hobby project. I hope something like this is possible. (I don't mean that I don't want to pay anything, but e.g. $20-50 a month is a bit expensive for it)
Upvotes: 2
Views: 1458
Reputation: 139
I've been there, GCP and AWS and other cloud providers can be overwhelming at first. There are so many services and sometimes it's hard to understand the differences.
Let's try to simplify first : do you need a separate NodeJS backend ? If it's a hobby project, maybe NextJS API routes are enough. This would simplify your stack greatly, because you could deploy everything in a single service on Cloud Run (front + back). API routes aren't as powerful as NestJS for example but can get you very far.
Then there's the Cloud Run vs App Engine debate. Even though App Engine is still actively maintained by Google, many people believe Cloud Run is the future. App Engine is for deploying code, Cloud Run for deploying containers, and containers are eating the world. App Engine was one of GCP's first offering and has many hidden features that can bite you. Choose what you prefer though.
Then, for persistence, again, so much choice. Maybe this decision tree can help :
Personal opinion : KISS, go with good old SQL : Google Cloud SQL with Postgres. You can very simply connect a Cloud Run service to a Cloud SQL instance.
Finally, there are many tutorials online explaining how to deploy NextJS on Cloud Run. You should find what you want.
Good luck !
Upvotes: 3