Networking Essentials medium
Why do database drivers and HTTP clients use 'Connection Pooling'?
- A To ensure that multiple disparate users can share the same encrypted login credentials when accessing a shared resource on a multi-tenant server.
- B To apply high-level AES-256 encryption to all data in transit between the application layer and the physical storage medium to ensure absolute privacy.
- C To eliminate the significant latency cost of repeated TCP/TLS handshakes by maintaining a set of open sockets that can be reused for multiple sequential requests.
- D To act as a preventive measure that keeps the underlying database from running out of physical disk space during high-frequency write operations.
Answer: C. To eliminate the significant latency cost of repeated TCP/TLS handshakes by maintaining a set of open sockets that can be reused for multiple sequential requests.
Establishing a new connection (especially an encrypted one) is an expensive operation in terms of both CPU and network latency. Connection pooling allows an application to 'borrow' an existing connection from a pre-allocated pool, use it for a request, and then return it for others to use. This 'Keep-Alive' strategy is critical for high-performance systems. However, it requires a trade-off: maintaining long-lived idle connections consumes memory and file descriptors on both the client and server. If the pool is too large, it might overwhelm the server; if it's too small, the application will stall waiting for an available socket.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the downside of enabling 'Sticky Sessions' (Session Affinity) on a Load Balancer?
- In WebRTC (P2P Mesh), why is a STUN server required?
- What is the fundamental difference between a Network Switch and a Router?
- In Cloud Networking (AWS), what is the limitation of VPC Peering compared to a Transit Gateway?
- Which protocol is ideal for real-time multiplayer gaming positions or Voice over IP (VoIP), and why?
- What is the purpose of the 'Time To Live' (TTL) field in an IP packet?