3

I am using a ASP.net session in SQL Server mode. I have created the necessary tables and stored procs in a custome db

My question is: Can I use this database to serve more than one application / web site ? Is there anything to take into consideration having multiple websites use the same db for their session store

cheers

1
  • the asp.net session support is useful for a low throughput site but I came to hate the feature as our site grew in traffic. We eventually disabled it because it was the main consumer of my db i/o resources even when I stopped setting/getting anything from state. It is so generic that you can store anything, but that comes at a cost. I highly recommend you roll your own if you have only meager state needs. Commented Jun 11, 2009 at 13:05

2 Answers 2

2

Yes you can use this database to server more than one site. The session provider will take care of the semantics of that.

Sign up to request clarification or add additional context in comments.

Comments

1

It would make the profiling more difficult if there is a performance problem. Why not create a second state db for the second application? It's not much to do, simple with a different name and specify the different db in your session configuration.

The short answer though is you can use the same session database and each session should be fine, though I wonder if anyone has any comments on colliding sessionIds between the two applications.

2 Comments

Not necessarily--you could just as easily specify the Application Name parameter in the query string and use that to differentiate the apps if you do need to run some profiling. That is presuming all your apps are running under the same SQL user name. Session IDs are GUIDs so collisions basically follow GUID collision contention. In most realistic scenarios you probably don't have to worry about it.
EDIT: err, I meant to say "Application Name paramter in the connection string" but it's pre coffee so there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.