Skip to content

Cleanup orphaned connection using DynamoDB TTL + DynamoDB Streams #3

@hakobera

Description

@hakobera

Sometimes client does not correctly send ws.close() event. So we need to clean up.

As of now, AWS API Gateway WebSocket have maximum 2 hours time limit, so we can record connection when we get $onconnect and safely clean it after 2.5 hours later.

  • Setup DynamDB TTL feature for connections table
  • Add Lambda to clean DynamoDB table and connect it to DynamoDB Streams
    • When record in connections table is deleted, we also need to cleanup rooms table

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions