Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scaling SignalR with SQL server - how often can we clear data?

I'm looking to write a scaled out SignalR application using SQL Server, using this article as a guidline. After doing some testing, it looks like the table Messages_0 in the SignalR database that I created (per the article) could get pretty big.

What I'm wondering is, how often can this data be cleared out? I see there is an InsertedOn column so I would think after day or two the data wouldn't be relevant anymore. Is there any documentation or guidelines on this?

I'm wondering if I could just set up a job that would clear out anything older than a week just to prevent the table from getting too big over time.

like image 772
lhan Avatar asked Jan 10 '23 12:01

lhan


1 Answers

I was looking for the same thing, and I did read the suggestion in the documentation, but I was wondering if SignalR would clean up by itself in that case, and when.

I found the answer here: How to cleanup SignalR SQL database Which points to the github repository, where you can see how SignalR automatically cleans the tables when reaching a hardcoded limit. See github code here: SignalR SQL automatical clean-up

Thought it might be useful to add to this question, for anyone searching the same question.

like image 118
Baz Avatar answered Mar 08 '23 14:03

Baz