Query: Which is the best choice for real-time data WebSockets or rest API?
Context: WebSocket approach is ideal for real-time scalable applications, whereas REST is better suited for the scenario with lots of getting requests. WebSocket is a stateful protocol, whereas REST is based on a stateless protocol, i.e. the client does not need to know about the server and the same hold true for the server.