views:

199

answers:

3

Has anyone had any experience scaling out SQL Server in a multi reader single writer fashion. If not can anyone suggest a suitable alternative for a read intensive web application, that they have experience with

+1  A: 

I don't have any experience with scaling out SQL Server for your scenario. However for a Read-Intensive application, I would be looking at reducing the load on the database and employ a Cache Strategy using something like Memcache or MS Velocity

There are two approaches that I'm aware of:

  1. Have the entire database loaded into the Cache and manage Adding and Updating of items in the cache.

  2. Add items to the cache only when they are requested and remove them when a write operation is performed.

+1  A: 

Some kind of replication would do the trick.
http://msdn.microsoft.com/en-us/library/ms151827.aspx

You of course need to change your app code.

Some people use partitioned tables, with different row ranges being stored on different servers - united with views. This would be invisible to the app. Federation for this practice, I think.

By designing your database, application and server configuration (SQL particulars - location of data/log/system/sql binaries/tempdb), you should be able to handle a pretty good load. Try not to complicate things if you don't have to.

Sam
+1  A: 

It depends on probably 2 things:

  1. How big each single write is?
  2. Do readers need real time data?

A write will block readers when writing, but if each write is small and fast then readers won't notice.

If you offload, say, end of day reporting then you batch your load onto a separate server because readers do not require real time data. This makes sense

A write on your primary server must be synched to your offload secondary server... which will block there as part of the synch process anyway + you add an overhead load to manage the synch.

Most apps are 95%+ read anyway all the time. For example, an update or delete is a read followed by a write.

My choice would be (probably, based on the low write volume and it's a web app) to scale up and stuff as much RAM as I could in the DB server with separate disk paths for the data and log files of the database.

gbn
how do writes block reads in a scaled out db cluster?
Greg Dean
Writers always block readers on the rows in contention, subject to locking granularity.If you have scaled out (implies federating and partitioned views) then only for that partition being written.Writes must occur however you scale out/offload, but more will happen with replication etc
gbn
If I understand you correctly you are talking about the writes that occur when the the read instances are updated from the write (i.e. from replication)?
Greg Dean
Exactly. Sorry if I was not clear.What size is the database please? I meant to ask...
gbn
Current estimates are ~500 GB
Greg Dean
Not too bad. Just add as much RAM as you can... 2TB on 64 bit...Found this in my bookmarks too: http://msdn.microsoft.com/en-us/library/aa479364.aspx
gbn
Funny you should mention that link. I had just read that article before posting the question. It doesn't mention anything about MRSW
Greg Dean