json - PHP - What's the best way to deal with huge amount of data -
thanks reading, i'm working on magento website. in case want store products data in .json files using cron. there 14 stores , each has more 2000 products , it's growing in both store , product number. on algorithm following:
foreach available store [ define globalarray = array() store products collection foreach product [ add product data globalarray add product filterable attributes globalarray ... ] save globalarray in json file ]
the problem required memory big, i'm thinking saving data each 200 product in temp json , @ end load temp json file , merge them in 1 big json .
what best way deal that? , solution good? in advance
use magento core/resource_iterator model. nice explanation can found at: http://www.atwix.com/magento/working-with-large-collections/
edit: recipe nice associative array can serialize or jsonify. guess serializing quicker.
i tend not ask why wants this! have no clue want achieve product data in non sql format.
Comments
Post a Comment