Storing transient data for chat sessions

For an AI driven chatbot over channels I want to store some transient data. There will be 10’s of thousands of concurrent users. Will be hosted on AWS using either EB, ECR or EKS, i.e. using multiple machines/pods. What will be the best method to store transient data for chat sessions? Store them simply in socket.assigns or using ElasticCache (Redis, Memcached, Valkey)?

ETS (Erlang Term Storage) is the go-to batteries-included for transient storage on the BEAM VM. I always recommend using it for any out-of-process transient storage until incompatible requirements reveal themselves and push you towards a more apt solution.

1 Like

I want the data to be accessible to all machines. Read that Mnesia can do that in conjunction with a strategy to let all the nodes be aware of each other.

I really have to ask… what’s wrong with a regular database?

1 Like

I prefer in memory DB for that sort of data. I will give AWS ElasticCache a try (Valkey).

I see. Well, if you want to make full use of AWS and are not worried about vendor lock-in then ElasticCache seems like a very good option indeed.

1 Like