Save static data through AppPool Recycles utilities

I created an ASP.Net MVC 3 application that allows users to search through various media files based on their file names. There are a large number of these files, so I created an inverted index that I keep in memory. In particular, I tell this as

Dictionary<string,List<string>>. 

Well, this index must first be created for searchability, so I created a method for creating it. It works fine, and everything is fine, but naturally, every time AppPool is updated, my index is lost. I tried disabling the AppPool utility, but I assume this is a bad idea (and it doesn't seem to work).

I'm basically not sure what my next step should be. Is there a way to detect when AppPool is going to update and rebuild my index? Or is it safe to disable the application pool utility at all?

Cheers, -Josh

+3
source share
3 answers

Assuming the index is accessible to it, I would think that you can serialize the index to Application_disposed and then de-serialize it in the application_start event in the global asax?

+2
source

, , . , , ; . , , ( leiu ). , , , . , , , . , , .

, ( , ), . , - , , , - , . .

+3

If you need a persistent keystore / value store, I would suggest something like Redis . I have had good success using this product in extremely large volumes (more than 500 million transactions per hour).

0
source

All Articles