3 ms·
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
by tboyd47 8y ago
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.
- kijin 8y agoIt 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.
- aryamaan 8y agoWhy don't people put backend + load balancer servers directly in front of the public? What all use cases are of using web servers?
- therealdrag0 8y agoI'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.