Re: Maintaining collections that are frequently updated
Posted: Fri Aug 07, 2009 11:27 am
by allistar >> Tue, 2 Apr 2002 3:00:04 GMT
Hi Craig,
The maintenance of such a system is no more than of a single collection, as long as are using set/change methods and keep
properties protected instead of public as appropriate.
We have a site (basically a call centre) that has 80-120 users using the system all at one time, as well as a few automated processes (updating from another call centre, printing as well as exporting and importing bank files). This collection was a big bottleneck, mainly because it was the collection that was searched on the most, but was
also updated quite frequently.
When the system was being used heavily we noticed that adding
objects into this collection could take 20 seconds (because the collection was being locked and unlocked so often by so many people at once). Breaking the collections up made a big difference, for obvious reasons (because only one tenth of the "collection" was being locked
at any one time).
The most amount of work went into working our how to hash the key in such a way as to give the best spread. I.e. so that each collection
gets filled up as equally as possible.
I would have no issues with implementing it in this way again,
although as you say it would be better for the database itself to
handle this (by only locking portions of the dictionary at a time).
Regards,
Allistar.
Hi Craig,
The maintenance of such a system is no more than of a single collection, as long as are using set/change methods and keep
properties protected instead of public as appropriate.
We have a site (basically a call centre) that has 80-120 users using the system all at one time, as well as a few automated processes (updating from another call centre, printing as well as exporting and importing bank files). This collection was a big bottleneck, mainly because it was the collection that was searched on the most, but was
also updated quite frequently.
When the system was being used heavily we noticed that adding
objects into this collection could take 20 seconds (because the collection was being locked and unlocked so often by so many people at once). Breaking the collections up made a big difference, for obvious reasons (because only one tenth of the "collection" was being locked
at any one time).
The most amount of work went into working our how to hash the key in such a way as to give the best spread. I.e. so that each collection
gets filled up as equally as possible.
I would have no issues with implementing it in this way again,
although as you say it would be better for the database itself to
handle this (by only locking portions of the dictionary at a time).
Regards,
Allistar.