Server Side & Client Side Languages

Hello everyone. I'm struggling to understand how server side language and client side language communicate to display information/data. When the processing occurs on the server, how is the result outputted on the client side? And more importantly, what does the data consist of? Let's take Netflix or any other VOD service. How does that work? From what I understand based on what I've read about the difference between the two languages, the actual audio-video should not be made available on the client side. But from what I've seen, all such services still send the video data but it's segmented and assorted using m3u8 or pls playlist formatting. If the process was in fact entirely server sided, other than screen recording, there should not be any means of capturing the data coming through, because there shouldn't be any data. But given that something needs to be displayed and some audio has to be played, some or the other kind of information must be sent to the user's computer. So my last question, how is it beneficial to have a back-end support for such a service? I would also like to know what data it is that actually gets processed on the servers.
How netflix streams videos is (a) mostly proprietary and (b) very complex regardless (especially when data shards get involved). A basic server/client model communicate over sockets, and use some protocol to send data back and forth. That data might be encoded further in a serialization format such as base64, ASN.1, JSON, XML, etc. The data that is sent back and forth just depends on what data the client and server both need.

Example:

A is a client to get an expression from the user and send it to B.
B is a server that processes algebraic expressions.

A reads a line of input (21 * 2), and sends it to B.
B processes and evaluates the expression, then sends the result back to A.
A displays the result.

As you can see in this basic example, A only sends B what B needs (the raw expression), and B only sends to A what A needs (the result).
Last edited on
Thank you for the explanation but that seems highly inefficient for streaming services as the result is the video that needs to be displayed and the audio which needs to be played. So is it that instead of making the location available on the web page, they take the user-input which in this case would be click on the play button and send the request back to the server which would then locate the file and send the segmented file directly to the user's computer without actually exposing the location of the file? At times, I have seen the link/location to the file when a web page is getting loaded in the bottom corner as it usually includes 'abc.xyzcdn'. It's very common when the service uses Akamai or Amazon's S3 CDN.
check out RTSP (Real Time Streaming Protocol)
it should explain how streaming works

https://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol
Last edited on
That model isn't inefficient. It is not meant for video streaming. Video streaming is a very complex process, that goes way beyond a simple 2 way protocol (and for netflix it is even worse).
Thank you all for your contribution. Would it be possible for anyone to tell me how two different languages communicate? Do they develop a software to interpret for difference in syntax and such?
When you're talking across sockets it's all basically plain text. You would take an image for example, read in a block of data from the file into a memory map or just a text stream and send that chunk of the file as text to the other socket. Because of this no translation between client or server programming languages is needed as long as they follow the same formats and protocols.
Last edited on
@Computergeek01 - Thank you!
Topic archived. No new replies allowed.