PERBANDINGAN METODE BACKEND SERVER-SENT EVENT DENGAN WEBSOCKET UNTUK KOMUNIKASI SISTEM PERINGATAN DINI DI WILAYAH PESISIR
Zildiray Alfirli, Prof. Ir. Lukito Edi Nugroho, M.Sc., Ph.D.;Prof. Ir. P. Insap Santosa, M.Sc., Ph.D., IPU.
2025 | Skripsi | TEKNOLOGI INFORMASI
Indonesia, sebagai negara kepulauan terbesar di dunia, memiliki garis pantai sepanjang 108.000 kilometer yang menjadikan wilayah pesisir sebagai pusat kegiatan sosial dan ekonomi. Namun, kondisi geografis ini juga menjadikan wilayah pesisir sangat rentan terhadap bencana alam, terutama gempa bumi, tsunami, dan bencana hidrometeorologi. Dengan meningkatnya ancaman tersebut, pengembangan Early Warning System (EWS) menjadi sangat penting untuk mendeteksi dan menyebarkan informasi ancaman secara cepat kepada masyarakat. Salah satu komponen penting dalam sistem ini adalah metode komunikasi yang digunakan oleh server backend untuk mengirimkan data menuju klien.
Salah satu tantangan utama dalam pengembangan sistem peringatan dini adalah pemilihan metode komunikasi backend yang efisien, cepat, dan mampu menangani banyak pengguna. Penelitian ini bertujuan untuk membandingkan performa dua metode komunikasi backend, yaitu Server-Sent Event (SSE) dan WebSocket, dalam konteks pengiriman data satu arah dari server ke klien pada sistem peringatan dini di wilayah pesisir.
Metodologi yang digunakan dalam penelitian ini mencakup pengujian performa metode komunikasi server backend berdasarkan empat metrik utama, yaitu throughput, latency, penggunaan CPU, dan penggunaan memory. Pengujian dilakukan melalui dua pendekatan, yaitu load testing dan performance testing. Pada load testing, digunakan automated testing untuk menyimulasikan beban hingga 5.000 pengguna guna mengukur throughput, penggunaan memory, dan CPU. Sementara itu, performance testing dilakukan melalui manual testing dengan lima perangkat mobile untuk mengevaluasi performa sistem dalam kondisi nyata guna mengukur latency serta penggunaan CPU dan memory dari masing-masing server backend.
Hasil penelitian menunjukkan bahwa pada skala pengguna yang rendah, SSE memiliki performa yang lebih baik dibandingkan WebSocket, khususnya dalam hal throughput dan efisiensi penggunaan sumber daya. Namun, pada skala pengguna yang tinggi, WebSocket menunjukkan keunggulan dalam aspek throughput dan lebih efisien dalam penggunaan CPU maupun memory. Selain itu, WebSocket juga menunjukkan nilai latency yang lebih rendah dibandingkan SSE. Dengan demikian, SSE lebih sesuai digunakan pada skenario dengan jumlah pengguna yang terbatas, sementara WebSocket lebih cocok diterapkan pada sistem berskala besar yang memerlukan distribusi data secara cepat dan efisien. Temuan ini memberikan implikasi penting dalam pemilihan metode komunikasi backend untuk sistem peringatan dini, khususnya di wilayah pesisir yang membutuhkan respons cepat dan andal.
Indonesia, as the world's largest archipelago, has a coastline stretching 108,000 kilometers, making coastal areas the center of social and economic activity. However, this geographical condition also makes coastal areas highly vulnerable to natural disasters, particularly earthquakes, tsunamis, and hydrometeorological disasters. With the increasing threat, the development of an Early Warning System (EWS) has become crucial for detecting and disseminating threat information quickly to the public. One of the key components of this system is the communication method used by the backend server to send data to clients.
One of the main challenges in developing an early warning system is selecting an efficient, fast, and scalable backend communication method. This study aims to compare the performance of two backend communication methods, namely Server-Sent Event (SSE) and WebSocket, in the context of one-way data transmission from the server to the client in an early warning system in coastal areas.
The methodology used in this study includes testing the performance of the server backend communication method based on four main metrics, namely throughput, latency, CPU usage, and memory usage. The testing was conducted through two approaches, namely load testing and performance testing. In load testing, automated testing was used to simulate a load of up to 5,000 users to measure throughput, memory usage, and CPU usage. Meanwhile, performance testing was conducted through manual testing with five mobile devices to evaluate system performance in real-world conditions to measure latency as well as CPU and memory usage of each backend server.
The results of the study show that at low user scales, SSE performs better than WebSocket, particularly in terms of throughput and resource usage efficiency. However, at high user scales, WebSocket shows superiority in terms of throughput and is more efficient in CPU and memory usage. Additionally, WebSocket also exhibits lower latency values compared to SSE. Therefore, SSE is more suitable for scenarios with a limited number of users, while WebSocket is more appropriate for large-scale systems requiring fast and efficient data distribution. These findings have important implications for selecting backend communication methods for early warning systems, particularly in coastal areas that require fast and reliable responses.
Kata Kunci : WebSocket, Server-Sent Event, Backend, Software Testing, Early Warning System