Network ProtocolPolling

This is a Network Protocol where the client periodically asks the server if any new messages are available. Depending on how the polling frequency is configured, polling can become costly.

Polling is a method of querying a target device or service to see if it has new data or information. Polling can be used to check for new data on a regular basis, or it can be used to check for new data only when a specific event occurs.

Polling can be used to retrieve new data as soon as it is available, without waiting for a response from the target device or service.

Polling can reduce the amount of data transmitted over a network, by only transmitting data that has changed since the last poll. This can be especially beneficial in low-bandwidth or high-latency networks.

What are the drawbacks of polling?

Polling can introduce latency into a system, as the target device or service may take some time to respond to a poll. Polling can also consume resources on both the target device and the polling device, as each poll requires the target device to process the request and the polling device to wait for a response.

How can polling be used in system design?

Polling can be used in system design to check for new data or events on a regular basis or to check for new data only when a specific event occurs. Polling can be used to retrieve new data as soon as it is available, without waiting for a response from the target device or service. Polling can be used to reduce the amount of data transmitted over a network, by only transmitting data that has changed since the last poll.

What are some common polling algorithms?

Common polling algorithms include:

  • Polling with a fixed interval
  • Polling with a variable interval
  • Polling with a fixed number of attempts
  • Polling with a variable number of attempts

What are some common polling applications?

Common polling applications include:

  • Network monitoring
  • System status monitoring
  • Data collection
  • Event notification

During the System Design Interview

Be prepared to discuss how you would use polling in a system design, to discuss the benefits and drawbacks and the different algorithms and applications.