my script requires me to make, ‘save’, use, edit, and re-save very complex variables every 24 hours (as the new data comes in every 24 hours) for a prolonged period of time, usually an year or so. I have an array which contains other arrays, objects, which further contains more arrays and objects thus its making it a very complex array. I was wondering what option is the most efficient option for this long term data. A sql database, or saving varibles in a php file which can be included in other scripts for use or php APC.
my script requires me to make, ‘save’, use, edit, and re-save very complex variables
Share
You could try using a NoSQL type of database for storing your complex data structures, as you would not then need to have a well-defined schema that you break them into. Alternateively if your data structure is safe for PHP serialization, you could store it in an SQL database keyed by date. Another suggestion might be to use memcached or similar.
If storing in a filesystem if appropriate for your case, I have oftentimes stored data structures in JSON-encoded files as well.