Lumen API development and consuming it for An e-commerce Application built in OpenCart
E-commerce application manage products, customers, orders, taxes rules, coupon codes and more.
Challenges
We need to implement a module where thousands of unique product records are being inserted, updated and deleted through excel sheet on specific time interval twice in 24 hours. Application features like vendors creation and deletion, activation and suspension of specific vendor due to non-compliance, fetching records based on markups were the basic components of module. After rigorous data and load testing, we evaluated the server key performance metrics and the results were not satisfactory. The reports revealed over-utilization of server resources, the web server was crashing, memory limit was over exhausted every time the database operations were performed, & at the same time, end users complained for slow accessing of the web-app or sometimes complete shut-down.
Solution
To overcome above problems, we decided to build bunch of APIs as per our module that had been staged on different web-server or we can call it as API-gateway. Lumen as API development platform was chose (Laravel based micro-services and blazing fast APIs). Below are the APIs we have created,
- Vendor Registration : New Supplier can be can be easily created.
- Vendor Activation/Deactivation : Suppliers can be activated for upload data sheet and display it in fetch API, if deactivated then supplier cant’t upload data through excel sheet.
- Vendor Deletion : Suppliers can be deleted using this API.
- Fetch Data for dashboard : API to fetch data which can be easily mapped with graph representational.
- Apply Markup : Markup can be easily applied based on different parameters like price, size.
- Authentication : To fetch data authentication of user is required once authenticated it will return data.
- Fetch data for End users : Fetch data based on different filters which can be display in front user.
- Excel Sheet Upload : API to upload file based on time interval applied in cron job automatically or can be upload manually by selecting a excel sheet.
Conclusion
By using all the above APIs we were able to upload excel sheet, supplier create/delete, apply markups and fetch data with different filters from eCommerce application. The results were awesome. Server performance was very good on all the metrics. The slow speed of the app, high download time and data rendering issues were resolved. The users had a very good comments on the new adoption.
Add your comment