What language/s and tools are you most familiar with? As a general rule, given general purpose languages (JS or PHP, for example) and general purpose tools (relational dBs like Postgres or Maria, for example, servers like Apache, frameworks like Express), those language/s and tools will be the best for most web applications under most circumstances.
If you’re just learning and you want to learn a set of tools that work well together, either is fine. If you were building a fully featured production app that will be used by lots of people, either is fine. If you were a big business with millions of dollars in turnover, either is fine. If you are looking for something with the best job prospects, every single piece of technology used in those stacks is very widely used, either is fine.
It is difficult to give an answer to that – re the process for any one is unique, and based on what it is, what it needs to do.
The basic principle is you rent a computer (or space on one) that is connected to the internet, and you install and run your application on that. Then you can access it via the IP address of that computer. It’s a big subject because there is normally quite a lot involved in doing that, and every big app is normally unique in the things they need. Many, many tools and services exist to make this easier but probably the best way to understand is to just pick a service with a free tier – Heroku or AWS or Google or Azure or whatever – and build and deploy stuff to it.
The stack isn’t particularly important: it shouldn’t in any way going to decide the actual logic of how a complex application is built.
As a word of warning, if you’re a beginner, you can aim for this, it’s a good learning exercise. But complicated production ready apps are not particularly engrossing things to build – 90% of the effort is grinding through tests and bugs and configuration and build tooling issues, often for weeks and months – so temper your expectations until you’re very familiar with some of the tools.
Categorizing databases as being “hosted locally” is not a meaningful distinction when it comes to production web apps. Having one monstrous virtual machine handle all database I/O would be impractical; instead, you containerize the applications needed to run the site (including the database). This allows horizontal scaling, ie spinning up more resources when you actually need them.
freeCodeCamp likely employs sharding to keep data in sync across geographic regions.
I may be wrong on this but I think Microsoft Azure + a managed MongoDb cluster (ie it’s a cloud-hosted service). As I say, I might be correct there. What is this important?
what @liam.stojanovic says re Mongo (this applies to most big dB stuff). It is practical to have the dB managed, effectively just means you pay someone else to handle the stuff that’s painful to maintain.
And yeah it’s all containerised (which is another deployment thing, another complexity/abstraction)