A Hybrid WebSocket-REST Approach for Scalable Real-Time API Design`
DOI:
https://doi.org/10.63282/3050-9246.IJETCSIT-V2I3P107Keywords:
WebSocket, REST API, Real-Time Communication, Scalability, Hybrid Architecture, Client-Server Model, Low Latency, API DesignAbstract
The rapid increase of real-time web applications and scalable systems during recent years demands sturdy architectural systems that enable effective data exchange. Representational State Transfer APIs operate traditionally through stateless communication methods that are widely adopted thanks to their basic design and compatibility features. The real-time bidirectional communication capabilities of REST APIs come short when several applications, such as chat systems, multiplayer games, and financial trading platforms, require efficient functionality. WebSockets conduct real-time data exchanges through full-duplex communication across a single TCP connection, although they necessitate higher complexities during deployment and when expanding system capacity. A new architectural design unites WebSocket and REST capabilities for building web APIs, which provide scalability and real-time functionality. The hybrid design architectural model implements REST throughout initial state retrieval and client control tasks and then utilizes WebSocket functions for live time communications, status synchronization, and event dissemination. The proposed architecture performance analysis under different test loads shows results against implementations that use pure WebSocket and REST interfaces. Experimental studies show that implementing hybrid technology results in substantial enhancements of latency combined with improved throughputs and lowered server resource consumption, especially within highly concurrent systems. The architecture evaluation takes place through testing on an e-commerce simulation platform, which shows its effectiveness in meeting concrete business needs. Security implications alongside fault tolerance and scalability enhancements form the main topics of this research paper. A combination of WebSocket and REST architecture creates a feasible platform that substantially benefits modern applications needing real-time capabilities without compromising scalability
Downloads
References
[1] Fielding, R. T. (2000). Architectural styles and the design of network-based software architectures. University of California, Irvine.
[2] Pautasso, C., Zimmermann, O., & Leymann, F. (2008, April). Restful web services vs." big"' web services: making the right architectural decision in Proceedings of the 17th international conference on World Wide Web (pp. 805-814).
[3] Fette, I., & Melnikov, A. (2011). Rfc 6455: The WebSocket protocol.
[4] Lubbers, P., Albers, B., Salim, F., & Pye, T. (2011). Pro HTML5 programming (pp. 107-133). New York, NY, USA:: Apress.
[5] Calheiros, R. N., Ranjan, R., Beloglazov, A., De Rose, C. A., & Buyya, R. (2011). CloudSim: a toolkit for modeling and simulation of cloud computing environments and evaluation of resource provisioning algorithms. Software: Practice and Experience, 41(1), 23-50.
[6] Halder, D., Kumar, P., Bhushan, S., & Baswade, A. M. (2021, July). FybrrStream: A WebRTC-based, efficient, and scalable P2P live streaming platform. In 2021 International Conference on Computer Communications and Networks (ICCCN) (pp. 1-9). IEEE.
[7] Zhao, S. M., Xia, X. L., & Le, J. J. (2013). A real-time web application solution based on Node. Js and WebSocket. Advanced Materials Research, 816, 1111-1115.
[8] Liu, Q., Yang, G., Zhao, R., & Xia, Y. (2018, October). Design and implementation of a real-time monitoring system for wireless coverage data based on a web socket. In 2018 IEEE 3rd international conference on cloud computing and Internet of Things (CCIOT) (pp. 63-67). IEEE.
[9] Liu, Q., & Sun, X. (2012). Research of web real-time communication based on web socket. International Journal of Communications, Network and System Sciences, 5(12), 797-801.
[10] Rasool, S., & Mukhtar, H. (2013, December). Adaptive traffic switching between WebRTC and WebSocket based on the battery status of portable devices. In 2013 Taibah University International Conference on Advances in Information Technology for the Holy Quran and Its Sciences (pp. 345-351). IEEE.
[11] Costa, B., Pires, P. F., Delicato, F. C., & Merson, P. (2014, April). Evaluating a Representational State Transfer (REST) architecture: What is the impact of REST on my architecture? In 2014 IEEE/IFIP Conference on Software Architecture (pp. 105-114). IEEE.
[12] Zou, J., Mei, J., & Wang, Y. (2010, July). From representational state transfer to accountable state transfer architecture. In 2010 IEEE International Conference on Web Services (pp. 299-306). IEEE.
[13] Rodríguez, C., Baez, M., Daniel, F., Casati, F., Trabucco, J. C., Canali, L., & Percannella, G. (2016). REST APIs: A large-scale analysis of compliance with principles and best practices. In Web Engineering: 16th International Conference, ICWE 2016, Lugano, Switzerland, June 6-9, 2016. Proceedings 16 (pp. 21-39). Springer International Publishing.
[14] De Backere, F., Hanssens, B., Heynssens, R., Houthooft, R., Zuliani, A., Verstichel, S., ... & De Turck, F. (2014, May). Design of a security mechanism for RESTful Web Service communication through mobile clients. In 2014 IEEE Network Operations and Management Symposium (NOMS) (pp. 1-6). IEEE.
[15] Masse, M. (2011). REST API design rulebook: designing consistent RESTful web service interfaces. " O'Reilly Media, Inc.".
[16] Biehl, M. (2016). RESTful API design (Vol. 3). API-University Press.
[17] Subramanian, H., & Raj, P. (2019). Hands-On RESTful API Design Patterns and Best Practices: Design, develop, and deploy highly adaptable, scalable, and secure RESTful web APIs. Packt Publishing Ltd.
[18] Skvorc, D., Horvat, M., & Srbljic, S. (2014, May). Performance evaluation of Websocket protocol for implementation of full-duplex web streams. In 2014, the 37th International Convention on information and communication technology, electronics, and microelectronics (MIPRO) (pp. 1003-1008). IEEE.
[19] Imre, G., Mezei, G., & Sarosi, R. (2016, June). Introduction to a WebSocket benchmarking infrastructure. In 2016, Zooming Innovation in Consumer Electronics International Conference (ZINC) (pp. 84-87). IEEE.
[20] Ogundeyi, K. E., & Yinka-Banjo, C. (2019). WebSocket in real-time application. Nigerian Journal of Technology, 38(4), 1010-1020.