1
votes

I am setting up a simple bot with Bot Framework V4 Node.js. As per the documentation, ConversationState with memory storage is not intended for Production bots. I just need to store some temporary variables (to keep track of a counter) for each conversation. Can I use memoryStorage in this case, as i don't want to persist the data permanently? Will there be any memory usage issues in Production if many users are accessing the bot?

1
I can't answer specifically on your question, but I have used memorystorage for most of the PoCs I've done, some basically production level, and haven't had any issues. That said, have you looked into using Blob storage for saving state? I have one bot using that and have not incurred any costs. Using Blob should be a no or low cost option to avoid the question here. - billoverton

1 Answers

2
votes

The problem with using memory storage in production bots is bigger than just the matter of memory storage being temporary. Conversation state in general can be considered temporary because conversations can be considered temporary. Memory storage should not be used when a bot is deployed because a deployed bot can have many instances running simultaneously across multiple servers. Each instance will have its own memory, and each user in each conversation may be sending messages to different instances on different turns. That's why you should always use an external storage service for deployed bots.

You can see in the SDK how a counter is handled in prompt.ts. Of course, if you don't want to keep track of the counter in your dialog state then you can create your own property accessor.