On 4 Dec 2012, at 10:51, rene7705 <rene7...@gmail.com> wrote:

> I would also like to hear any thoughts on how to efficiently add,
> delete and edit data in this large and deep array structure from
> multiple sessions at nearly the same time..
> 
> On Tue, Dec 4, 2012 at 11:49 AM, rene7705 <rene7...@gmail.com> wrote:
>> Hi folks..
>> 
>> I'm wondering, what's the fastest way to put a large and deep array()
>> structure in shared memory on a PHP server?

Split the data up into smaller pieces. There's rarely a valid reason to store a 
huge array of data as a single blob. It's an array, so it breaks up by the 
first level of keys at the very least.

Look at APC, memcached, and redis. These are the most popular ways to store 
data in shared memory. Note that APC is a PHP extension so you can only access 
the shared memory from one machine, whereas memcached and redis are separate 
daemons so you can access them from multiple servers.

Also, as Sebastian says, a database is another option unless you have a good 
reason to want the data in shared memory rather than a DB.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to