Kran
Kran

Reputation: 83

Ms Bot framework - where to store data?

I have a situation where i need to keep the state of 5 variables of approx. 10,000 users.

I only need to keep the state during the session. If a user close down the window the data shall be cleared of security reasons and GDPR.

The bot Will be on Facebook. There will be no authentication required for the user.

I think it will be to much to manage with the in memory storage.

Is table storage a good option here? Or any better suggestions?

Upvotes: 2

Views: 1679

Answers (2)

Dana V
Dana V

Reputation: 1347

As @Kamran said, you can use any number of storage options for the backend state storage.

Regarding the issue around session lifetime; memory storage is volatile because when the service restarts, you lose your state. Which is good for testing. But it won't really map to a users session. You could have a new 'session' but still have saved state in memory storage. You will want to look into the conversation ID, and perhaps have logic around that. That is the closest thing to session lifetime.

Upvotes: 0

Kamran
Kamran

Reputation: 1380

For testing and prototyping purposes, you can use the Bot Builder Framework's in-memory data storage. For production bots, you can implement your own storage adapter or use one of Azure Extensions. The Azure Extensions allow you to store your bot's state data in either Table Storage, CosmosDB, or SQL.

https://learn.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-state?view=azure-bot-service-3.0

Upvotes: 1

Related Questions