Currently trying to differentiate when to use Servers & when to go Serverless.
Serverless will scale infinitely, although it has 1 small cost of cold starts but if the site is used regularly then cold start is not needed.
Servers are inherently costly. Even if we don't use it to its full potential we need to always choose a higher plan than our current usage.
I want to know when can we go full Serverless.
Like I have 1 app where the flow is like -
- User clicks on SignIn
- Email is sent to the user with Magic Link
- After Magic Link is clicked, user is logged in
- User can then buy a product
- After payment, user can download the product
- User can Logout
Can this be done serverless ?
Also, which websites would be Serverless & which would need Servers ?
The canonical example of serverless is for handling web requests i.e. 1 function per HTTP route. Database will still need to be on a static server. Managing user login / state etc. will be cumbersome across multiple different functions, however the email and payment processing handlers may be better candidates for serverless functions. A thin front-end and DB on static servers with serverless used for emails+payment processing would be a good initial architecture