Heyo! This was a thought that popped into my mind when I was thinking about apps I could make, and I realized that this would actually be a pretty solid blog post.
This isn't usually a decision most developers have to make, as it is almost always clearly cut out. Need to fetch or process stuff from a database? Use a server. Making something simple like a notes app or a calendar? Easy peasy, that goes into serverless. However, there's a few edge cases that force you to make this decision, so I'll help explain what benefits you'd gain from it and the cons you'd gain from it.
For anyone new in the scene of programming, serverless architecture is when you develop an app that does not use a server. Simple, right? All computation needed is done entirely on the client, which can save a TON of money, due to the costs of a dedicated server being super expensive. Whether you're using a server host such as Linode (not sponsored) or even self hosting, costs can rise quickly. Serverless architecture eliminates that extra cost, only leaving you with the cost of hosting the client, which, depending on how much research you do and the type of app you're making, can be free.
Now, let's start with the pros. I already went over one of them: the cost. If you skipped over that section, I'll do a quick summary: servers cost hella money, no matter what form you choose them in. Serverless architecture doesn't use that money, letting you allocate it to more important things like hosting the client or paying devs for making the app, if you've got a team you pay. Another useful thing that you benefit from it is automatic scaling. If you're a type of person that does minimal feature launches for your projects or products and then slowly expands (think the way Google releases products), this can actually be really useful. The app grows with you, but with a server-based architecture, you'd be forced to periodically upgrade servers which would be really expensive, or get a massive server off the bat, which is insanely risky (what if your product is a total flop?), because then you'd just.. have it. Not much to do with it, unless you decide to split it between projects. Additionally, serverless architecture just frees up your hands and space on the clock. You don't have to spend any extra time dealing with maintenance because a storage unit died, you don't need to investigate why it is returning garbage data with tested-okay code, etc etc. You just deal with the client, and that's it. More time to work on development, more focus on what you need focusing on, so on so forth. Next, the cons.
A major con about serverless architecture is just how much it relies on the device it is running on, and there isn't exactly any other device to relieve resource usage because all of the code is being ran on the client device. It makes the bold assumption that whatever you're doing and whatever you're using is on the same firmware as the device(s) you test it on, and that the computer is even powerful enough to run it. Please, tell me the last time you saw Minecraft with full shaders running on a Galaxy S2 smartphone (the answer: you probably haven't, let alone at the standard 60fps/120fps of the phone). Instruct me on how to get Firefox 115 running on Windows 98 SE. This is one of the biggest reasons for why servers exist: they do the bulk of the computation. YouTube would NOT be able to run the algorithm everyone tries to manipulate for views without their servers with 10 exabytes of storage for videos with their accompaning metadata and above-the-line processors. And not to mention, serverless applications make exploiting them for personal gain so much easier to do, because exploiters and decompilers will take your program in its full and rip it to shreds just to find a single vulnerability. Better make sure it doesn't connect to the internet!
Anyways, I had a ton of fun writing this, but that is to be expected when you haven't written any blog posts in over half a year. I really hope you learned at least something decent or useful from this, because that'd make me happy (and maybe attract more viewers to my blog if you REALLY liked it). For more tech related insights and accidental forkbombs, tune into the CheeseBlog for more posts just like this. Cya!