Simple session state storage with Lambda?

Seems like you are trying to use lambda for stateful session, whilst they are best for stateless compute. Is there any chance you can reinvestigate your architecture to see if that is really needed or can it be avoided through a redesign (eg, through client side caching)? Without knowing the overall use case, it is hard to suggest a better architecture, but I’d suggest giving it a serious thought.

If it must be done, best way to approach it is to push the session variables into the next layer, hence the other suggestions above to persist it in DB. For such simple name value pairs, obviously a no-sql db makes a good choice.

Good to know. Thanks!

As an alternative approach, you could store the session data client side. A JSON Web Token can then be used to authenticate users. This eliminates the need to store data on the host-side, and it’s a popular solution for this type of problem.

read and write files in an s3 bucket

DynamoDb without a doubt.

You can also set a TTL so it will automatically remove old data

Using S3 is an option, but DynamoDB is going to be a better fit.

Route53 is also an option, but probably not a great fit.

but be careful, it will ‘eventually delete’ after that date. so always make sure to include this TTL in your query