PERBANDINGAN PERFORMA SMART CONTRACT ETHEREUM DAN POLYGON DENGAN HYBRID LOGGING UNTUK PENCATATAN DATA INTERNET OF THINGS PADA SIMULASI KLASTER K3D
Muhammad Lutfi Zunnur, Dr. Ronald Adrian, S.T., M.Eng.
2025 | Tugas Akhir | D4 TEKNOLOGI JARINGAN
Smart farming menghasilkan data sensor Internet of Things (IoT) berfrekuensi tinggi yang membutuhkan integritas melalui blockchain, namun pencatatan seluruh data high-frequency pada blockchain sering terhambat oleh latensi dan throughput jaringan. Proyek ini merancang dan menguji alur pencatatan data IoT ke blockchain dengan pendekatan hybrid logging untuk membandingkan performa Ethereum dan Polygon pada smart contract. Sistem menggunakan simulasi sensor, middleware yang melakukan hashing dan penyimpanan data lengkap di MongoDB, dan kontrak yang mencatat ringkasan hash dan waktu di jaringan Ethereum Virtual Machine (EVM). Dua klaster terpisah berbasis k3d digunakan agar trafik tidak saling memengaruhi. Pengujian beban dilakukan secara terkontrol dan kinerja diukur pada dua metrik, yaitu latensi end-to-end dan throughput. Hasil menunjukkan bahwa hybrid logging berjalan baik dengan menunjukkan hash antara on-chain dan off-chain yang bernilai sama. Dari performa, Polygon konsisten lebih cepat daripada Ethereum, dengan latensi median pada Polygon antara 3.68 hingga 3.83 detik, sedangkan latensi median pada Ethereum antara 7.84 hingga 11.69 detik, serta throughput pada Polygon antara 5.65 hingga 7.88 transaksi per detik dan throughput pada Ethereum 2.56 hingga 3.96 transaksi per detik. Perbedaan dipengaruhi waktu blok yang lebih singkat pada Polygon sehingga konfirmasi terjadi lebih sering.
Smart farming generates high-frequency Internet of Things (IoT) sensor data that requires integrity through blockchain, but recording all high-frequency data on the blockchain is often hampered by network latency and throughput. This project designs and tests an IoT data logging flow to blockchain using a hybrid logging approach to compare the performance of Ethereum and Polygon on smart contracts. The system uses sensor simulations, middleware that performs hashing and complete data storage in MongoDB, and contracts that record hash summaries and times on the Ethereum Virtual Machine (EVM) network. Two separate k3d-based clusters are used so that traffic does not affect each other. Load testing was conducted in a controlled manner and performance was measured on two metrics, namely end-to-end latency and throughput. The results show that hybrid logging works well by showing that the on-chain and off-chain hashes have the same value. In terms of performance, Polygon is consistently faster than Ethereum, with median latency on Polygon between 3.68 and 3.83 seconds, while the median latency on Ethereum was between 7.84 and 11.69 seconds, and the throughput on Polygon was between 5.65 and 7.88 transactions per second and the throughput on Ethereum was between 2.56 and 3.96 transactions per second. The difference was influenced by the shorter block time on Polygon, which resulted in more frequent confirmations.
Kata Kunci : blockchain, smart contract, Ethereum, Polygon, hybrid logging, k3d, latensi, throughput