Joel's SharePoint Architect Blog

SharePoint 2013 Training, Architecture, Administration and Development

Subscribe Subscribe  View Joel Jeffery's profile on LinkedIn
joelblogs.co.uk | joelj.co.uk | joeljeffery.co.uk | jfdiphoenix.co.uk

Posts Tagged ‘SharePoint Architecture’

AllUserData Table Changes in SharePoint 2013 Content Databases

Has anybody else noticed something’s changed with the schema of the Content Database in SharePoint 2013? The AllUserData table has changed.

Look, but don’t touch!

Try a SELECT * FROM AllUserData and see what you get:

SharePoint 2013 AllUserData Table

First of all, what’s happened to columns [nvarchar1], [nvarchar2] (skip a few) [nvarchar64]? How about [int1] to [int16]?

They’ve all been combined into a fragment of Xml, and stored in a single column [tp_ColumnSet].

Let’s zoom in and have a look at one of those Column Sets:

tp_ColumnSet from AllUserData Table

That’s interesting.

Wide List Issues

Firstly, this means “wide lists” are going to be potentially faster than under 2010. A “wide list” in SharePoint 2010 was one that had so many columns that it would cause an INSERT or UPDATE statement to affect more than 8000 bytes of row data.

To work around the problem, when SP2010 works out the column you’re about to add to a list could cause more than 8000 bytes to be written, it would instead create an additional row to hold the new columns. SharePoint used the [tp_RowOrdinal] column to number each of the rows accordingly for a wide list.

We expect SQL Server to start table locking the AllUserData table as the number of row locks approaches 5000. Wide list behaviour would potentially cause SQL Server to have locky behaviour at one-half as many rows (or one-third, or one-quarter – depending upon how many list columns and therefore SQL rows).

Now it’s all stored in one big column, that particular problem is going to go away.

I was bored, so I added 66 text columns to a list. It was all stored in one row, in that one column.

Wide List

However, the [tp_RowOrdinal] column still exists in the SharePoint 2013 content database, and I’m not sure why.

SharePoint 2013 Content Databases and Sparse Columns

SQL 2008, 2008R2 and SQL 2012 all support “sparse columns” and “column sets“. These are SQL technologies that allows a row to grow beyond the usual 8K-per-row limit (up to 2GB of data when expressed as Xml). Under the hood, the AllUserData table still has [nvarchar1] through to [nvarchar64] and beyond! In fact there are 262 nvarchars, 100 bits, 550 datetimes, 550 floats, 750 ints, 262 ntexts, 262 sql_variants, 350 uniqueidentifiers and 2 geographies (in a pear tree). (Thank you to Lior Gal for pointing me in the right direction!)

See the MSDN reference article on SharePoint 2013 AllUserData table design here: http://msdn.microsoft.com/en-us/library/hh625524.aspx.

But why didn’t these show up in SQL Management Studio? This is behaviour by designer to prevent poor performance when selecting form wide tables.

AllUserData Performance Issues in SharePoint 2013

Three general observations:

  1. For list sizes below 5000 SQL rows, lists that don’t use SharePoint indexed columns will probably be slower.
  2. For lists greater than 5000 SQL rows, unless we’re using SharePoint column indices in our query, SharePoint list throttling should kick in, and terminate the query before it gets started.
  3. For most list use cases, it is still massively important to use SharePoint column indices. But if you do decide to switch off throttling for a list, performance should be faster than under SharePoint 2007.

So, in summary: even in SharePoint 2013, make sure you have suitable indexed columns.

Technorati Tags: SharePoint 2013, SharePoint Architecture

SharePoint Documentation Kit (SPDocKit)

I need to tell you about something fantastic.

SharePoint Documentation Kit – SPDocKit Review

I’ve been using SPDocKit from Acceleratio for about 6 months now, on and off. One of the services we offer at JFDI Phoenix is our SharePoint 2010 Farm Health Check, and this involves a lot of boring navigation through Central Admin and some gnarly PowerShell to gather farm insight. Collecting settings information by hand is tough and time consuming.

The value-add for customers comes from what I can deduce from their configuration – what problems they’ll see; whether their platform will scale; whether it will be secure enough.

SPDocKit helps me gather the vast majority of the information I need, and formats it into a very detailed, very useful report in Word format.

Here’s just a snippet from the table of contents:

SPDocKit Table of Contents

It goes on to produce a detailed inventory of each server in the farm:

Farm Overview

It even builds a Visio-style diagram showing the farm topology. OK, I know it looks daft when I run it on a one-server farm, but it is vastly more impressive on a multi-server farm!

Farm Topology

It also identifies and lists:

  • Services on server, per server
  • Site topology (site collections per web application)
  • Web applications
  • Self-service site creation settings
  • Alternate access mappings
  • IIS settings
  • Site collection usage
  • Quota templates
  • Service applications
  • Detailed settings for each application
  • Databases used
  • Permissions
  • Associations to web applications and proxy groups
  • Content databases, usage and quotas
  • System settings, including email and SMS settings
  • Features and solutions
  • Sandbox configuration
  • Monitoring and reporting
  • Security
  • Administrators
  • Managed accounts
  • Service accounts
  • Products and versions
  • Scheduled tasks
  • Server information
  • Hardware / cores
  • Installed programs and hotfixes
  • Drives and free space

If this wasn’t enough, it also lets you record all this information and monitor changes over time.

More Features!

And there’s more! The SPDocKit application itself has a pretty useful UI. You can browse the web application and site structure without needing to generate documentation:

Site Explorer

It also lets you walk the permissions of your sites. Very useful if you’ve been breaking inheritance and you want to know who has access to what. Having said that, SharePoint’s built-in “Check Effective Permissions” button is still invaluable to debugging permissions problems.

Permssions Explorer

There’s also a Detailed Permissions report, but this is still a very interactive tool:

Detailed Permissions

There’s even best practices analysis built in:

Best Practices

Although obviously not exhaustive, it does give a very good start for a more detailed analysis of a farm.

There’s also a Scheduled Tasks viewer:

Scheduled Tasks

Conclusion

Whilst SPDocKit is not magic, it certainly saves me a great deal of time on SharePoint farm health checks. The licensing is pretty cool also. You can either buy it for an individual farm, of have a yearly subscription as a consultant. If you’re using the latter, the setup exe lets you run it on a server without leaving it installed afterwards.

Technorati Tags: SharePoint 2010, SharePoint Administration, SharePoint Architecture

The “Bad Command” Song from my SharePoint Show

Despite protests from music lovers, here is another of the songs from my SharePoint Show.

This is a mix from several live versions. In this song we visit what you can and can’t do in the Sandbox, and the several ways in which the User Code Service protects our server from the evils of any user code that tries to run a “Bad Command”.

Apologies to Lady Gaga, and all those who have been affected by issues in this video.

Technorati Tags: SharePoint, SharePoint 2010 Training, SharePoint Administration, SharePoint Architecture, SharePoint Development, SharePoint Videos

SharePoint Visio Stencils for IT Pros and Administrators

I recently had a question from one of my students:

Every time I create a Visio diagram for a SharePoint farm, I start with an existing diagram and use the shapes from that. Are there any Visio stencils for SharePoint?

Yes! There are! You can download a set of Visio stencils for architectural drawings of SharePoint farms from Microsoft here: http://bit.ly/spstencil.

Example

The stencils let you produce diagrams like this one from TechNet: http://technet.microsoft.com/en-us/library/cc263199.aspx

Example SharePoint Architecture Diagram with Visio Stencils

Installation

You need to unzip this to your My Shapes folder under your Documents folder, e.g.:

"%USERPROFILE%\Documents\My Shapes"

Technorati Tags: SharePoint 2010, SharePoint Administration, SharePoint Architecture

Event Receivers and Content Deployment Jobs

SharePoint 2010 has many wonderful improvements over previous versions. One of which is a vastly improved Content Deployment mechanism and API.

If your application makes use of Event Receivers or Feature Receivers, these can, depending upon what they do, cause problems during a Content Deployment job. If you have code that you’d rather not execute when your event is triggered as a side effect of a Content Deployment job, you can use the SPImportContext object to find out if a job is running, and if so, to take alternative action.

Here’s an example on an ItemAdding Event Receiver (you’ll also need a using statement referring to the Microsoft.SharePoint.Deployment namespace)

   1: /// <summary>

   2: /// An item is being added.

   3: /// </summary>

   4: public override void ItemAdding(SPItemEventProperties properties)

   5: {

   6:     if (!SPImportContext.Current.IsRunning)

   7:     {

   8:         //TODO: add event receiver code here

   9:         base.ItemAdding(properties);

  10:     }

  11: }

If you miss this out this check in an Event Receiver or Feature Receiver, you might cause deadlocks or spurious List Items that you did not intend.

Technorati Tags: Development, SharePoint 2010, SharePoint Architecture, SharePoint Developer