The Wayback Machine - https://web.archive.org/web/20240822104252/https://www.geeksforgeeks.org/polling-and-streaming-concept-scenarios/
Open In App

Polling and Streaming – Concept & Scenarios

Last Updated : 02 Dec, 2022
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In systems, clients and servers communicate together in which client requests and server responds back to the respective client with requested data. Now there can be choices on at what frequency do I need to update the data? Well, it all depends on your purpose and your system. Here we are going to discuss two basic concepts Polling and Streaming.

Polling

It is defined as the process when a client requests a particular piece of data at regular intervals (maybe every x seconds) and the server reverts with a usual response with the required data.

In these scenarios, where the client needs to update the data (get the data from the server) regularly at instant mode, polling may not benefit your architecture. Ex: You are building a chat app where you have many clients that are meant to communicate with each other in real-time. As a System Design Expert, you need to make sure that the client gets the updates instantaneously (here updates means chats, txt, messages). But Polling is not suitable everywhere as an example of Chatbox, you need to get the instantaneous message as the other end sends it, but due to set interval of x seconds you are unable to get the instant feel of messages and your messages would feel a lot of delays

The best suitability of Polling can be getting temperature updates maybe 30sec/1min of regular intervals.

Streaming

Streaming is done through sockets, you can learn about sockets in detail here.  In Layman terms, sockets are a file that your computer can write/read from in a long width connection with another computer, an open connection till one machine turns it off.

Ex: Designing a Chat Application just like WhatsApp/Instagram and many others

Here you might think of a choice of reducing the set intervals and use Polling instead of Streaming, that is, you may think of reducing the set intervals to 1sec/0.5sec than within 10 seconds you are requesting up to 20 requests for a single client, and for millions of clients, this would create an issue for our server to handle these requests at the same time. Here you need to notice that you may get the instant experience in messages but this is not optimal as it would create much more load to a server.

Polling v/s Streaming

Key Point: In Polling, for a response of a server, each request is sent, but in streaming, the client listens openly with no external request of data from the server. On the server-side, for streaming, it would not wait for data to send for every request but will push the data as it notices any changes. Through streaming, you can get instant experience of chatting without any delay nor sending 10-20 requests per second per client.

Scenarios

When the client-side processing is slower than different scenarios may occur in the case of Polling and Streaming.

In Streaming the updates would form a long queue on the client-end and as soon as it receives the first event the server will send the next and then next continuously till the end, there would be a delay due to poor processing but there won’t be any sort of sporadic in the data.

In Polling the processes would take some time to update. As soon as it finishes one, it would ask for another and answer it immediately. The server always tries to be robust and to keep streaming connections working; if it can’t write, it will just wait and possibly filter updates.

Note: Streaming is not better than Polling, Polling might be better than streaming, It all depends on your use-case and system.

General Rule: If you need to get your data updated instantly (live updates) then you want to use streaming, and if you are building a dashboard than monitors stock prices or have such a use-case here you may prefer polling as there is no real need of open connection and every 30 sec you can get the data updated.



Similar Reads

Priority Interrupts | (S/W Polling and Daisy Chaining)
In I/O Interface (Interrupt and DMA Mode), we have discussed the concept behind the Interrupt-initiated I/O. To summarize, when I/O devices are ready for I/O transfer, they generate an interrupt request signal to the computer. The CPU receives this signal, suspends the current instructions it is executing, and then moves forward to service that tra
5 min read
Polling in System Design
Polling in system design is an important method for gathering data or monitoring device status at regular intervals. This article provides an overview of polling, its importance, applications, strategies, and challenges also. Important Topics for Polling in System Design What is Polling?Importance of Polling in System DesignPolling Mechanisms in Sy
10 min read
How to design a Live Video Streaming System Like ESPN
A Brief Overview In quite recent years, there has been increasing demand and growth in digital video processing and communication technology in the form of live streaming. Video streaming, that also live, requires a large amount of data to be processed and transferred within some limited bandwidth of communication channels. However, even with all t
8 min read
Buffering in Streaming Services
Have you ever noticed the grey region in the PlayProgressBar of YouTube / Netflix or any other streaming services? How come the YouTube Videos / Netflix content is streaming seamlessly with just a decent enough internet connection? It's nothing but a Buffering. Important Topics for the Buffering in Streaming Services What is a Buffer? What is Buffe
11 min read
Design a Live Streaming App like Twitch - System Design
When creating a live streaming application like Twitch – one has to use an approach that will not only cover functional and non-functional requirements but also create a detailed architectural design, and plan for scalability and reliability. The following sub-topics provide a thorough analysis of each of the major factors that can exist in the des
12 min read
Frugal Streaming - System Design
Frugal Streaming in System Design introduces efficient ways to handle large data streams with limited resources. It focuses on designing systems that can process and analyze continuous flows of data without requiring extensive computing power or storage. The article covers techniques to summarize and compress data in real-time, making it manageable
10 min read
Concept of Display Method in Software Engineering
Display methods are basically main and important methods that are employed by software inspection process simply to ensure and confirm correctness of code and also to validate formal models. In this method, display is a precise document i.e., accurate and correct document in which program is simply presented in a way that its correctness might be d
4 min read
Caching - System Design Concept
Caching is a system design concept that involves storing frequently accessed data in a location that is easily and quickly accessible. The purpose of caching is to improve the performance and efficiency of a system by reducing the amount of time it takes to access frequently accessed data. Important Topics for Caching in System Design What is Cachi
12 min read
Load Testing Basics, Tools & Practices in Software Testing
Introduction: Load testing is a type of performance testing that simulates a real-world load on a system or application to see how it performs under stress. The goal of load testing is to identify bottlenecks and identify the maximum number of users or transactions the system can handle. Some popular tools for load testing include Apache JMeter, Lo
6 min read
Tips for Designing a Plan to Learn Programming & Development
The majority of us make this mistake early on, where we try to learn everything there about Software Development. One day we are watching a tutorial on “Intro to Java”, and the next day, we try to build JARVIS (A.I) with Python. We all have been there, however, it seems like we are doing very well but in reality, we are going nowhere. Being able to
4 min read
Advantage & Disadvantage of Application Software
Application Software : Application Software is he kind of programming which runs according to client demand. Framework programming gave stage to application programming. Elevated level dialects are wont to compose machine programming. Its a particular reason programming. One of essential things to think about expression "application programming" is
3 min read
Parallel (Othographic & Oblique) Projection in Computer Graphics
Projection is a kind of phenomena that are used in computer graphics to map the view of a 3D object onto the projecting display panel where the viewing volume is specified by the world coordinate and then map these world coordinate over the view port.Projection is of the following kind : a) Parallel Projection b) Perspective Projection Parallel Pro
3 min read
Advantages & Disadvantages of COCOMO Model
Overview :Cocomo stands for Constructive Cost Model is a regression model based on LOC, i.e number of Lines of Code. COCOMO model is proposed by Boehm in 1981 It is a procedural cost estimate model for software projects and often used as a process of reliably predicting the various parameters related to making a project such as size, effort, cost,
3 min read
Robotic Process Automation - Prerequisites, Business Impact & Use Cases
Robotic Process Automation (RPA) is a technology that uses software robots (or "bots") to automate repetitive, rule-based tasks in a variety of business processes. RPA can help organizations improve efficiency, accuracy, and speed while reducing costs and freeing up employees to focus on more value-adding tasks. Prerequisites:Standardized and well-
6 min read
Difference between Time Tracking and Time and Attendance Software
Time tracking and time and attendance software are tools that help businesses track the time that employees spend on tasks and their attendance records. These tools can help businesses automate their time tracking processes, reduce errors and inaccuracies, and ensure that employees are paid accurately for the time they work. Time tracking software
4 min read
Risk Based Testing and Failure Mode and Effects Analysis
Risk is the probability of a negative or undesirable outcome or event. Risk is any problem that might occur that would decrease customer, user, stakeholder perception of quality and/or project success. Types of risks:There are 2 types of risks- Product Risk and Quality Risk. Product risk-When the Primary effect of a potential problem is on product
9 min read
Test Tools and Automation- Strategies , Costs, Risks and Benefits
Test tools can be very useful. Some tools are essential. For example- An incident tracking system. Generally, tools are meant to improve the efficiency and accuracy of testing. Hence, it is very important that we carefully select tools and properly implement them as well. Many times, it has been observed that a good tool also does not get properly
7 min read
Difference between Black Box and White and Grey Box Testing
software's1. Black Box Testing :Black box testing is a type of software testing in which the functionality of the software is not known. The testing is done without the internal knowledge of the products. It is also called Functional testing. Black-box testing focuses on software’s external attributes and behavior. This type of testing looks at an
3 min read
Difference between Agile and Kanban
1. Agile : Agile software development is a newer approach of software development. It is based on continuous iterative development approach throughout SDLC (Software Development Life Cycle) so that continuous changes are made according to immediate feedback/requirements and at last it results a good and effective software product which gives more s
3 min read
Difference between End-to-end Testing and Unit Testing
1. End-to-end Testing: End-to-end testing is the type of software testing used to test entire software from starting to the end along with its integration with the external interfaces. The main purpose of end-to-end testing is to identify the system dependencies and to make sure that the data integrity and communication with other systems, interfac
5 min read
Module Coupling and Its Types
Prerequisite - Coupling and Cohesion Coupling simply means to connect two or more things together. It means the pairing of two things. It actually measures the degree of independence between two things and how closely two things are connected or represent the strength of the relationship between them. Module coupling means to couple two to more mod
4 min read
Difference between FPGA and ASIC
Integrated circuits are the combination of microprocessors, diodes, resistors, and transistors and are also known as chips or microchips. Each of the components in the chip has its own specific functions. Both, ASICs and FPGAs are types of integrated circuits. Though, they are similar in their circuit design but differ in lots of ways such as their
3 min read
Difference between Software and Data
1. Software : Software, as name suggest, is simply a type of software systems or application in any program or group of programs that is especially designed for customer or end user and runs on computer system. 2. Data : Data, as name suggests, is simply a representation of facts, concepts, information, or instruction that is processed or stored by
2 min read
Advantages and Disadvantages of Emergency Maintenance (EM)
Emergency, I think all of you are familiar with this word. As name suggests, it is a serious and unexpected situation that is required to be immediately solved. One can say that emergency is a dangerous situation that requires immediate and quick action. Emergencies always occur without any warning. Similarly, in software engineering, there are cer
3 min read
Difference between SFA and CRM
1. Sales-Force Automation (SFA) : Sales-Force Automation technique helps to keep a track of sales person performance, as they plays major role in driving sales and contact information of probable customers and hence affecting revenues of business. This was reason that SFA came into existence for question- how and when customer requirement changes,
2 min read
Advantages and disadvantages of Test Driven Development (TDD)
Test Driven Development(TDD) : Test-Driven Development (TDD) is additionally called test-driven design. TDD may be a method of software development during which ASCII text file is tested over and once again (unit testing). Test-driven development may be a balanced approach for the programming perfectly blended with tightly interwoven three activiti
4 min read
Difference Between Azure DevOps and Jira
1. Azure DevOps :Azure DevOps is its own set of cloud services that have collaboration tools that work on any platform it is a tool that implements the DevOps lifecycle in a business. It provides you with a ready platform for turning your idea into a piece of software. It provides you with Agile tools which help in managing your tests, versioning y
3 min read
Editors and Its types in System Programming
Editors or text editors are software programs that enable the user to create and edit text files. In the field of programming, the term editor usually refers to source code editors that include many special features for writing and editing code. Notepad, Wordpad are some of the common editors used on Windows OS and vi, emacs, Jed, pico are the edit
7 min read
Difference between Software and Middleware
1. Software : Software, as name suggest, is simply a type of software systems or electronically stored data controls functioning of hardware, direct its operations and is independent of hardware as well as makes computer programmable. 2. Middleware : Middleware, as name suggests, is simply a type of software that lies between operating system and a
2 min read
Difference between Frontend Testing and Backend Testing
Front End Testing: Front End Testing is a type of testing that tests the presentation layer of a 3 tier architecture in a web application. Basically, front-end testing is performed on the user interface (UI) which is also known as the presentation layer in 3-tier architecture. Back End Testing: Back-end testing is a type of testing that tests the a
2 min read
three90RightbarBannerImg