Websocket or TCP or Push Notification

Software Programmer
Software Programmer used Ask the Experts™
on
Websocket or TCP or Push Notification ????

I am planning to build a mobile app to see the updates of stocks being added by the user as soon the price got updated.

1. Do we need to use Websocket or TCP or push notification in this case? Which one is better ?
2. Do we have any stock market test API's which supports Websocket or TCP or Push notification to cross check the feasibility, stability, reliability and latency ?
3. What are the differences between websocket vs TCP vs Push Notification ???

Need answers for the above three questions and the final decision as well. Please Suggest.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
DarrenSenior Software Engineer

Commented:
Hi,

This looks like homework.

Why don't you tell us why you would use one over the other and we can tell you if you are right.

Here is a test API and Websocket https://intrinio.com/

Thanks,

Darren

Author

Commented:
Darren,

These are genuine questions and not a homework
DarrenSenior Software Engineer

Commented:
Hi,

Okay, here's my two cents....

1. Do we need to use Websocket or TCP or push notification in this case? Which one is better ?  Firstly it depends on your requirements.

2. Do we have any stock market test API's which supports Websocket or TCP or Push notification to cross check the feasibility, stability, reliability and latency ?  Answer given above, I'm sure a quick search will find a few more. (Polling and WebSocket)

3. What are the differences between websocket vs TCP vs Push Notification ???

Websocket simply upgrades the http connection so it still works over http and you can then send messages both ways, from Client to Service and from Service to Client

TCP requires a direct TCP connection that may require more configuration and opening of ports etc... using (remoting or something similar)

Push Notification only works one way but may be more suited to your task as it has certain features like automatically trying to reestablish the connection if the client goes off line etc...

In my view for your particular requirement probably Push would be best in these circumstances

https://www.smashingmagazine.com/2018/02/sse-websockets-data-flow-http2/

Thanks,

Darren

Author

Commented:
Darren, thanks a lot for your answers. My requirement is simple, i will adding few stocks to the application and i will register and subscribe for the notifications in the exchange server for alerts whenever there is a change in the price of the stocks - it may happen every second or minute or hour and it is not predictable. in such a case, push notification or web socket or tcp would be useful

Since i am new to this , i couldn't get get much free APIs for testing. you can get 2 or 3 if possible and that would be helpful. searching online always didn't get the exact links which we are looking for.

Please let me know

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial