I am developing an affiliate website for products similar to www.dtashion.com but I'm facing some issues in updating price, stock and reviews for an individual product in real time. I am using Laravel and MySQL mainly for the development.
My approach:
- I am currently getting the product details from different websites for the different type of products. Each website supports the different way of providing the product details like in XML format, RESTful API format or simply crawling of their website data.
- I store each product into one single table with a flag represent the related website like vendor_type = 'FLIPKART' or 'AMAZON' or 'SNAPDEAL' and so on.
My questions are:
- Is my approach correct?
- Some websites provide data feed in XML or in RESTful style and for some websites I have to crawl the product details. Now, the problem is at first I can get the product price, stock details and the reviews on their product page or product tag but afterward, how I can update these details on daily basis?
- What is the best approach in terms of speed, latency, database optimization and etc?
Concerning your 1st and 3rd question: you didn't mention the exact way you do your job, you must mention it in order to judge it, but since its working, then that is a good job, you can always enhance.
Concerning the 2nd question, you can achieve it with task Scheduling in Laravel. If I were you, I will go for the Queuing option.
I hope the answer is beneficial for you, leave a comment if you still have questions.