we are currently using a NAS for PHP session files storage for an array of autoscaling load balanced app servers.
We are interested to replace this with a more robust solution and DynamoDB from Amazon looks interesting. I see one possible issue here, documented here:
http://thwartedefforts.org/2006/11/11/race-conditions-with-ajax-and-php-sessions/
I suspect DynamoDB does not support object locking. Any workarounds you can think of?
If you have any experience from other NoSQL systems used for PHP sessions also feel free to jump in as the learnings might be similar.
Thanks in advance
Using DynamoDB's conditional writes, you could implement a pessimistic locking scheme similar to the way PHP's default session handler works.
Someone else has also made a request for a DynamoDB session handler: https://forums.aws.amazon.com/thread.jspa?messageID=328060.
Updated: The AWS SDK for PHP now includes a session handler for DynamoDB. See https://github.com/amazonwebservices/aws-sdk-for-php/blob/master/extensions/dynamodbsessionhandler.class.php and http://docs.amazonwebservices.com/AWSSDKforPHP/latest/#i=DynamoDBSessionHandler
Updated: There is an article about the DynamoDB session handler on the AWS blog: http://aws.typepad.com/aws/2012/04/scalable-session-handling-in-php-using-amazon-dynamodb.html