wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.64k stars 1.18k forks source link

Fly by default creates 2 machines for server - document or change that? #1342

Open Martinsos opened 1 year ago

Martinsos commented 1 year ago

They create 2 machines for server, which is their recommended minimum, so you have availability while deploying new version of server and similar. But, I do wonder if this is what people expect -> it certainly surprised me quite a bit. Suggestions:

  1. Mention this in docs, to warn people.
  2. Consider having wasp by default create only one server machine (but then again we should inform users about this choice).
Martinsos commented 12 months ago

What does it even mean on Fly that 2 machines are used for server -> are they on at the same time? They have this thing where they shut down machines when they are not used -> so I guess only one of them is on normally? What if both are on? Is there some load balancing happening? Are they both used sometimes? In that case that might be an issue, if Wasp server is written in such a way that doesn't assume multiple server instances to be running (e.g. has some state).

infomiho commented 12 months ago

Here's Fly's bit of docs on the topic https://fly.io/docs/reference/app-availability/#redundancy-by-default-on-first-deploy

We should probably expose the option to use --ha=disable https://fly.io/docs/reference/app-availability/#turn-off-redundancy-on-deploy

Martinsos commented 12 months ago

I discussed this a bit more with @infomiho . What we will probably want to do is make it so by default 1 instance/machine of everything is created, and then inform user how they can bump it to 2 if they want. Once we get closer to 1.0 and invest proper effort into ensuring Wasp is horizontally scalable (docs, software support), then we can think more seriously about 2 machines being the default.