Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RavenDB ASP.NET session provider?

A little background: I currently make use of Memcached Providers for managing session state in my ASP.NET application. It provides facilities for using SQL Server as a fallback storage mechanism (when sessions need to be purged from the memcached cache). I'd like to look at creating a provider for RavenDB as it would be much more performant for this sort of task.

My question is, has anyone implemented such a thing? (or something similar?) - I'd hate to re-invent the wheel. Google does not yield any helpful results (other than my question about this in the RavenDB group itself), so I thought I'd take this question directly to the Stack Overflow community.

like image 828
DanP Avatar asked Aug 05 '10 13:08

DanP


3 Answers

I was also seeking a RavenDB session-state store, and my search also failed.

So I created one:

github.com/mjrichardson/RavenDbSessionStateStoreProvider

Also available via a NuGet package.

like image 117
MJ Richardson Avatar answered Nov 16 '22 01:11

MJ Richardson


Not as far as I know. RavenDB is pretty active project and Memcached has been practically dead for 2 yr and remained 32-bit. You might be better off just running RavenDB under IIS

OK, so code-wise it doesn't get smaller than this - single file: http://sourceforge.net/projects/aspnetsessmysql/files/MySqlSessionStateStore.cs/download

like image 42
ZXX Avatar answered Nov 16 '22 02:11

ZXX


RavenDb provides a Session expiration bundle which means that documents are deleted after a specified lifetime. This is ideal for use as a session and means that your entire aggregate root will be retrieved from RavenDb, meaning much cleaner code: RavenDb Expiration Bundle

like image 33
Peter Willis Avatar answered Nov 16 '22 01:11

Peter Willis