What can back-end do that front-end cant?

Hello, I just completed the API’s Microservices section. And it got me wondering: what does back-end do that front end can’t? It felt like everything that I was doing through node.js could be done in a different way simply using all the front-end stuff I’ve learned. Serving files for example: is that so different than just using an anchor element to accomplish showing the new file? Or when someone submits stuff of a form: that info can be handled in a front-end manner as well as the back-end manner.

Obviously my question is a very fundamental one, so there’s a fundamental thing that I’m not grasping. Can someone explain it to me, thx.

Shared data, mostly, such as a database. Your form data has to be stored somewhere after all. Used to be the backend did a lot more than that. There’s other services that the backend is well suited for, but they all more less boil down to sharing some form of state, such as storing the front-end application itself for you to run, storing your authentication secrets to log in, etc.

Hi!

Well, the main problem that You cannot solve with the front end is security, although it might not be the only problem. The front end is easily manipulable if You know how to use the developer tools, You would need to store the passwords in plain sight (imagine that, everyone could access Your database), etc.

Yes, and no. You can simply link them, true, but then how would You share information? The front end is something that works on clients only (be it a mobile or web app, etc.) hence You could not share information. You could not restrict information access without sessions, for example.

This is a security issue. The front end is only for displaying information; you should never rely on the client validation only. We must always validate the data on the server (which cannot be modified by the users–unless they hack the server) and the client (mainly because it’s user friendly).

Hope it helps You :slight_smile:.

1 Like