𝗦𝗲𝘀𝘀𝗶𝗼𝗻 𝟱 𝗦𝘂𝗺𝗺𝗮𝗿𝘆 ಸೆಷನ್ 5 ಸಾರಾಂಶ
I studied three ways to move data between a client and a server in my system design class today. ಇಂದು ನನ್ನ ಸಿಸ್ಟಮ್ ಡಿಸೈನ್ ತರಗತಿಯಲ್ಲಿ ಕ್ಲೈಂಟ್ ಮತ್ತು ಸರ್ವರ್ ನಡುವೆ ಡೇಟಾವನ್ನು ವರ್ಗಾಯಿಸುವ ಮೂರು ವಿಧಾನಗಳನ್ನು ನಾನು ಅಧ್ಯಯನ ಮಾಡಿದೆ.
Short Polling ಶಾರ್ಟ್ ಪೋಲಿಂಗ್
The client asks the server for updates at set times. You might set an interval of 5 seconds. The client sends a request every 5 seconds to check for new data. ಕ್ಲೈಂಟ್ ನಿಗದಿತ ಸಮಯಗಳಲ್ಲಿ ಸರ್ವರ್ನಿಂದ ಅಪ್ಡೇಟ್ಗಳನ್ನು ಕೇಳುತ್ತದೆ. ನೀವು 5 ಸೆಕೆಂಡುಗಳ ಅಂತರವನ್ನು ಹೊಂದಿಸಬಹುದು. ಹೊಸ ಡೇಟಾವನ್ನು ಪರಿಶೀಲಿಸಲು ಕ್ಲೈಂಟ್ ಪ್ರತಿ 5 ಸೆಕೆಂಡಿಗೆ ಒಂದು ವಿನಂತಿಯನ್ನು ಕಳುಹಿಸುತ್ತದೆ.
Long Polling ಲಾಂಗ್ ಪೋಲಿಂಗ್
The client sends a request to the server. The server holds the request until new data arrives. This method uses more server resources. It also wastes many connections. ಕ್ಲೈಂಟ್ ಸರ್ವರ್ಗೆ ವಿನಂತಿಯನ್ನು ಕಳುಹಿಸುತ್ತದೆ. ಹೊಸ ಡೇಟಾ ಬರುವವರೆಗೆ ಸರ್ವರ್ ಆ ವಿನಂತಿಯನ್ನು ಹಿಡಿದಿಟ್ಟುಕೊಳ್ಳುತ್ತದೆ. ಈ ವಿಧಾನವು ಹೆಚ್ಚಿನ ಸರ್ವರ್ ಸಂಪನ್ಮೂಲಗಳನ್ನು ಬಳಸುತ್ತದೆ. ಇದು ಅನೇಕ ಕನೆಕ್ಷನ್ಗಳನ್ನು ವ್ಯರ್ಥ ಮಾಡುತ್ತದೆ.
Server Side Events ಸರ್ವರ್ ಸೈಡ್ ಇವೆಂಟ್ಸ್
The server sends data to the client at regular intervals. In Javascript, you use the EventSource object to create this connection. The server pushes data to the client automatically. ಸರ್ವರ್ ನಿಯಮಿತ ಅಂತರದಲ್ಲಿ ಕ್ಲೈಂಟ್ಗೆ ಡೇಟಾವನ್ನು ಕಳುಹಿಸುತ್ತದೆ. Javascript ನಲ್ಲಿ, ಈ ಕನೆಕ್ಷನ್ ಅನ್ನು ರಚಿಸಲು ನೀವು EventSource ಆಬ್ಜೆಕ್ಟ್ ಅನ್ನು ಬಳಸುತ್ತೀರಿ. ಸರ್ವರ್ ಸ್ವಯಂಚಾಲಿತವಾಗಿ ಕ್ಲೈಂಟ್ಗೆ ಡೇಟಾವನ್ನು ಪುಶ್ ಮಾಡುತ್ತದೆ.
Source: https://dev.to/hvdineshbabu/session-5-summary-5agg ಮೂಲ: https://dev.to/hvdineshbabu/session-5-summary-5agg