Lurker News
I’d like to learn more about backend development but most of what I find while searching are results like “Build a nodejs backend in 20 minutes” or “learn backend development in an hour.” I think part of the problem is I don’t know enough to ask the right questions.

Comments (130) 48 threads

Show all comments

Showing thread 5 of 48

tboyd471 reply#
Client-server distinction.

It sounds easy ("derp, back-end is server, front-end is client") but it's really quite a mind bender when you think about it. Take a given piece of website code in a given language. Where is it being executed? Some "front-end" techs (Node, Webpack, Uglify, etc.) will be executed invisibly on the server. Some "back-end" web techs (cookies, redirects, OPTIONS requests, TLS) enable some invisible client behavior. Some (PHP) are dual-purpose, executed in two stages, some (conditional comments) are hacks that exploit this duality. Some (OAuth2) are orchestrated dances between back-end and front-end. It's really not so simple when you think about it.

kijin1 reply#
It gets even more complicated because your server is often a client, too.

Modern backend code will usually connect to databases and call REST APIs. The databases themselves might be part of a cluster. Moreover, the backend code is rarely exposed directly to the public; there's usually a proper http server sitting in front of it, and there might be another load balancer or CDN between the user and your http server. Every connection has a client and a server, and sometimes the same component plays both roles. Remembering which role(s) each component is playing in any given context is very important for security, not to mention debugging.

aryamaan1 reply#
Why don't people put backend + load balancer servers directly in front of the public?

What all use cases are of using web servers?

therealdrag0#
I'm not sure what OP meant. But for Java, your app runs inside an application server like Tomcat which handles the low level networking for you, I believe this fulfills a similar role as web servers fill for other languages like PHP.

Basically these severs provide a separation of concerns and are built to be more scale-able than a naive application listening on a port for requests.