14

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.

DanP
  • 6,310
  • 4
  • 40
  • 68
  • So are you looking at replacing SQL Server with RavenDB but still have the Memcached in there? Or you want to replace Memcached with RavenDB. Just wondering which one will give you better performance for session state. Thanks. – Tigran Jul 14 '13 at 05:00
  • I actually ended up going with Couchbase and making use of their aspnet providers implementation (for session state and output cache): https://github.com/couchbaselabs/couchbase-aspnet – DanP Jul 15 '13 at 13:29

3 Answers3

18

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.

MJ Richardson
  • 1,441
  • 12
  • 30
  • Nuget package appears to be incompatible with NewtonSoft Json 4.5.6. Nuget tries to "update" from 4.5.6. to 4.0.8... – Hendrik Wiese Oct 22 '12 at 19:29
  • [It is the RavenDB.Client package that is incompatible](http://ayende.com/blog/157505/ravendb-1-0-amp-newtonsoft-json-4-5-7). According to Ayende's post, you should be able to resolve your issue by referencing [version 1.0.971 of RavenDB.Client](http://nuget.org/packages/RavenDB.Client/1.0.971). – MJ Richardson Oct 25 '12 at 06:10
3

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

ZXX
  • 4,684
  • 27
  • 35
  • Thanks for the input, but memcached isn't really the issue here...more generally, I'm asking about creating a session provider for RavenDB. The memcached provider simply offers one example implementation of how this could work. – DanP Aug 13 '10 at 19:18
  • So you are actually looking for a reasonably small source code for an ASP.NET session provider talking to some other DB so that you can modify it for RavenDB? Unles you are totally opposed to writing some code :-) – ZXX Aug 14 '10 at 02:43
3

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

Peter Willis
  • 926
  • 5
  • 9