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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -