Closed Lansoweb closed 8 years ago
One of the differences between v2 and v3 is that the SDK no longer supports automated garbage collection. The reason for this change is that garbage collection is completed with a combination of Scan
and BatchWriteItem
operations, which can cause you to exceed your provisioned throughput capacity when garbage collection is automated.
This change turns automated garbage collection back on in Zend applications, which I don't think is the right approach. You should use scheduled garbage collection (say, by calling $sessionHandler->garbageCollect()
in a cron job) whether using the SDK or one of its framework integrations.
Hope that helps!
@jeskew True. But can we have just the gargabeCollect method calling the saveHandler's same method? There is no getSaveHandler method to call garbageCollect upon.
@jeskew Updated the PR accordingly.
That makes sense, but doesn't this couple your code to the DynamoDB session handler? No other instance of Zend\Session\SaveHandler\SaveHandlerInterface
will have a garbageCollect
method, so calling ->getSaveHandler()->garbageCollect()
isn't any more generic than creating an SDK session handler object and calling garbageCollect()
on it.
@jeskew Also true :) Guess i'll have to manually create the SDK session handler to make the garbageCollect(). Thanks!
On v3, as in official doc, the gc method does nothing anymore (found out the hard way :)), must call garbageCollect().