DEV Community

Discussion on: Explain Backend like I'm five.

Collapse
 
lbeul profile image
Louis

So, if I understood your correctly, I basically need a Backend for two cases:

  1. I need to store the data in a central place and therefore have to use some backend that connects a database to my frontend.
  2. I have to use more than just one technology or service and therefore need a backend that connects their functionality with my frontend?

Speaking of Frontend, I always thought that every interface that is used by humans is a frontend - e.g. my React WebApp, a Flutter mobile app or even some GUI written with C++.

Collapse
 
deciduously profile image
Ben Lovy • Edited

Your points are pretty spot-on - another would be to alleviate the computational load on the client. Like you say in your post:

a lot of logic already works in the Frontend

This is true, but it requires shipping a bunch of JavaScript over the wire, and making your users' computers do the heavy lifting on their end. You can reduce bandwidth by cutting down the amount of javascript you're transmitting and reduce the computational needs of your client-side frontend by offloading a lot of that logic to your backend. This will let your application work for people with lower resource requirements, and potentially reduce your client-side attack surface.

As far as what a "frontend" is, I agree with your list. All of those are frontends for a user to interact with your application.

Thread Thread
 
mootrichard profile image
Richard Moot

Totally agree with Ben here. That's why I had tried to narrow my definition of a frontend to I/O since its really just the layer for interacting with humans.

Offloading computation from the client is a really great point, and is the exact reason something like SSR (server side rendering) exists, since not all clients might have the computational power to be performant enough to match expectations.

Thread Thread
 
lbeul profile image
Louis

Thanks a lot @deciduously and @mootrichard !

Let the server lift the heavy weight of complex logic seems like a nice solution! In school we tinkered around with PHP for serverside rendered HTML forms (for calculating Body Mass Index and stuff like that) and I never got the point of it since you're able to do the same stuff in the frontend with JS.

I think, slowly I'm getting the bigger picture behind all that! 😊