GraphQL Analysis and Implementation on Go-Life Microservices (Case Study: Go-Life)
RIZA EGA SATYABUDHI, Mardhani Riasetiawan, M.T., Dr ; Guntur Budi Herwanto, S.Kom., M.Cs
2019 | Skripsi | S1 ILMU KOMPUTERREST sering digunakan sebagai protokol komunikasi untuk arsitektur berorientasi layanan seperti arsitektur microservice. Namun, REST memiliki dalam keterbatasan fleksibilitas yang berujung pada terjadinya masalah N +1. Dalam penelitian ini, sebuah studi kasus akan dilakukan pada microservices Go-Life, sebuah perusahaan teknologi Indonesia yang memberikan layanan pijat sesuai permintaan, layanan kebersihan, mekanik otomotif, dan layanan kecantikan, dengan menerapkan GraphQL dalam arsitektur microservice Go-Life, kemudian membandingkan dengan sistem yang ada yang hanya menggunakan REST. Saat ini masalah N +1 terjadi dalam microservice Go-Life yang menggunakan REST, di mana klien perlu melakukan beberapa permintaan jaringan HTTP ke server untuk meminta data relasional antar microservice. Hal ini menghasilkan waktu respons tinggi. Oleh karena itu implementasi GraphQL diusulkan untuk memecahkan masalah N +1. Perbandingan dalam penelitian ini didasarkan pada waktu respons yang dibutuhkan oleh masing-masing sistem, yaitu sistem yang ada yang menggunakan REST dan sistem yang diusulkan yang mengimplementasikan GraphQL, untuk menangani permintaan data relasional dan non-relasional dari klien. Dari penelitian ini, ditemukan bahwa pada arsitektur microservice Go-Life, setelah mengimplementasikan GraphQL, waktu respons yang diperlukan untuk menangani permintaan data relasional dan non-relasional dari klien dapat diturunkan, karena masalah N+1 telah diselesaikan. Oleh karena itu disarankan untuk mengimplementasikan GraphQL pada microservice Go-Life.
REST is often used as the communication protocol for service oriented architectures such as the microservice architecture. However, REST imposes restrictions in flexibility which leads to the occurrence of the N+1 problem. In this research, a case study will be made on Go-Life's microservices, an Indonesian tech company which delivers on-demand healthy massage, cleaning services, automotive mechanic, and beauty services, by implementing GraphQL in Go-Life's microservice architecture, then comparing it with their existing system which only uses REST. Currently the N+1 problem occurs within Go-Life's microservices which use REST, where the client needs to do multiple HTTP network request round trips to the server for requesting relational data between microservices. This leads to high response time. Therefore the implementation of GraphQL is proposed to solve the N+1 problem. The comparison in this research is based on the response time needed by each system, which are the existing system which uses REST and the proposed system which implements GraphQL, to handle relational and non-relational data request from the client. From this research, it is found that on Go-Life's microservice architecture, after implementing GraphQL the response time needed to handle relational and non-relational data request from the client are lowered, because the N+1 problem is solved. Therefore implementing GraphQL on Go-Life's microservice is recommended
Kata Kunci : GraphQL,REST,N+1 Problem,Response Time