FAQ resource for What is the difference between TCP and UDP?.
Answer
TCP is a connection-oriented transport protocol that guarantees ordered, reliable delivery using handshakes, acknowledgments, retransmission, and flow and congestion control. UDP is connectionless and sends datagrams with no delivery guarantees, ordering, or congestion control, trading reliability for lower latency and overhead. Use TCP when correctness and completeness matter, such as web pages, APIs, and file transfer. Use UDP when speed and timeliness matter more than perfect delivery, such as live video, voice, gaming, and DNS lookups.