| [I haven't watched the video - I come to HN to read .. but that said] > I don't think the communication protocol between two processes, services, whatever has have the property of being synchronous or asynchronous. This is news to those of us who have implemented or designed communication protocols between processes. > It is more about how each side of the communication handles it internally. You are confusing processing of information obtained via communication with the pattern of communication. A synchronous protocol is a lock-step exchange of data/meta-data between two communicating processes. You can have processes communicating via a synchronous protocol that handle the processing in an asynchronous manner. An asynchronous protocol does not require exchange of messages to be lock-step A: HELO w/ MY CREDS <blocks>
B: HELO - ACCEPT CREDS
A: GET 'foo' <blocks>
B: HERE is 'foo' <data>
[A: queue foo data for async processing by an internal comp A']
A: GET 'bar' <blocks>
[A': processed 'foo']
B: HERE is 'bar' <data>
[A: queue bar data for async processing by an internal comp A']
...
[A': processed 'bar']
and then there could be this: A: HELO w/ MY CREDS <blocks>
B: HELO - ACCEPT CREDS
A: GET 'foo' <doesn't block>
A: GET 'bar' <doesn't block>
B: HERE is 'foo' <data> # B may even return 'bar' first in some cases
[A: queue foo data for processing ...]
A: GET 'foobar' <doesn't block>
B: HERE is 'bar' <data>
[A: queue bar data for processing]
...
B: HERE is 'foobar' <data>
...
Quaint diagrams we used to draw for protocols - this is just some random example from a quick search [note how it transitions from a sync handshake to async comm]:https://www.researchgate.net/publication/344006359/figure/fi... |
I'd say the IP protocol is asynchronous in terms of flinging individual packets around. They can be buffered, delayed, etc. They can arrive at the recipient without notice.
TCP starts to make it "more synchronous" since the two parties have to signal back and forth negotiate coordinated buffers and perform a sequence of steps within timeout deadlines.
SMTP seems more asynchronous in terms of whole messages being delivered and stored without protocol-level coordination between messages.
Non-pipelined HTTP 1.1 is both "more synchronous" and "less synchronous". It adds more timing behavior to the use of TCP to have simplex phases of client-sending and server-sending. At the same time, you can think of the request and response messages a bit like email messages to be stored and forwarded. But there are narrower response time limits for an HTTP message pair to succeed or fail at the transport level compared to a message and reply via email.
Of course, these different scenarios are happening all at once in a normal SMTP or HTTP exchange. So the abstractions layered over introduce new protocol units which may have synchronous or asynchronous characteristics, while the underlying primitives continue to also occur with their own apparent characteristics.
A similar issue exists with voice over IP. The protocol is duplex streams which seems quite asynchronous to me. But a typical conversation involves synchronization at human language boundaries and is quite sensitive to latency. Conference calls can fall apart when participants lose synchronization and start talking over each other. This is a social communication protocol layered over the underlying audio streaming protocol.