Speed Comparison OF Websocket And HTTP In IOT Data Communication - Friendly, Friendly; Sembiring, Ajulio Padly; Faza, Sharfina; Luckyhasnita, Andam (INFOKUM, 2022)
IOT devices is connected using various method. Two of most commonly used methods are websocket and HTTP Api. According to the results of the test, number of loads and data size can increase the time duration for each communication method either websocket or HTTP api. Api and websocket has a wider range usage and large data transfer. API and websocket is more preferred than other method as these methods is easy to implement and the server configuration is not complicated. API is most common as the protocol is HTTP that can be setup by using common hosting service. Incontrolling IOT devices, response time is very important. Delay in sending message may cause bad user experience as user may think that the devices might be malfunction. In this research we measured the time needed to control an IOT devices using HTTP using API protocol and websocket. Base on our research, The process between pushing the controller button and the IOT devices execute the task is faster when using the websocket while using the HTTP. Websocket is much better option in data exchange than the HTTP api. The average time of websocket in data exchange between the server and IOT devices is between 554-711 mili second while the average time of HTTP api is between 2.7-4.5 second. This test is done by calculating the round trip of the process, thus the process in the IOT devices where the data is processed is included and measured.