Modernizing log: Part 1, Conventional REST API to GraphQL
Iâve been working on a Laravel and AngularJS application for two years now. Itâs slowly becoming more and more complex and itâs starting to become very difficult to manage. Every single Angular view needs at least 5 different resources to fully work and this is becoming a problem for our servers with a high visitor count.
Lately, Iâve been reading about GraphQL and how you can perfectly query all the required data you need in a single HTTP request. This would solve a lot of problems Iâm currently experiencing with PHP-FPM.
So right now Iâll research and set up a testing page with a single HTTP request to GraphQL API endpoints. Iâm going to see if this reduced the high server load Iâm currently experiencing. Along with the server load, Iâm going to have to measure the loading times for this single request. The current solution for a product page makes 20 different resource requests, but these requests are tiny, so the page loads quickly. However, with a high visitor load, this completely overloads PHP-FPM.
So there are two things Iâm going to have to test for now: server load (preferably seeing a huge reduction), and response times (preferably low enough to facilitate a quick page load).
In the next post, Iâll document my findings.
Posted on: March 14th, 2018I help you achieve great SEO, higher conversions, and help you grow your business