I have a concept that I want to get peoples opinions on for running sessions in AWS with the redundancy of DynamoDB and the speed of Elasticache.
- PHP stores sessions in DynamoDB.
- When sessions are written to DynamoDB the values are also written to Elasticache (possibly stored as JSON in one key pair for fast entire retrieval.
- PHP then queries Elasticache for sessions.
- If PHP can't find a session in Elasticache it checks DynamoDB - therefore providing a backup for node failure, cluster failure and site failure. If the session is found its written back to Elasticache (if possible) and if not a new session is created in DynamoDB.
Good, bad, messy, to complex??