Last month, I have attended European SharePoint Conference held in London. Overall the conference was a success and everybody learnt a lot from SharePoint MVPs, who are best in delivering of what they know. I have written down my notes during the conference and decided to share best practices discussed in the sessions that I had attended. Once I will receive DVD of all sessions, I will update my blog to provide more information on best practices discussed in other sessions.
Session: Best Practices for developing a SharePoint Web Part (Presented by Todd Bleeker)
§ Naming Convention for choosing library name
o CompanyProject.Contents.Purpose
e.g. PMCentrix.WebParts.Navigation
o Naming Convetion for Choosing Web Part class name
[Purpose]Part.cs
e.g. MyTasksPart.cs
§ Path of User Controls
Create a folder under ..[12 hive]\template\controltemplates\UserControl\
Create a User Control folder for a place to deploy all of your user controls.
§ Inherit Web Part class by using ASP.NET Web Part Library to develop a web part
o i.e. System.Web.UI.WebControls.WebParts
§ Always use CreateChildControls() as an event to write your code
o Never use Render()event of a web part
o Never use RenderControl()event of a web part
o Rarely use RenderContents() event of a web part
o Avoid using OnInit() event
o Always call the Base Class method before even your try... catch statement
§ Must sign and give strong name to your web part assembly
§ Consider to deploy your web part assembly in the web application BIN directory instead of GAC i.e. Prefer to use Code Access Security (CAS) instead of Global Assembly Cache (GAC) for deploying web part assembly
o Benefits of deploy Web Part assembly into BIN folder:
§ Fastest iterative approach i.e. code, compile and refresh
§ No need to recycle application pool of web application
§ Use Static Version for versioning of your web part assembly
§ WSPBuilder is an industry tested tool for creating a deployment package for your web part, so why not use it.
§ Use Web Part properties and avoid and hardcoded text
§ Call EnsureChildControls() procedure before writing your web part code in the CreateChildControls() event
Session: SharePoint, SQL Server Storage Best Practices (Presented by Mike Watson)
§ SQL Health is equal to SharePoint Health, so never only consider the sizing matrix of SharePoint
§ How to scale SQL Server: You have two options; Scale Up i.e. by adding more memory or add more SQL Servers in the cluster or Scale Out i.e. Add another SQL Server after every 1TB of content space
§ Scale Out is more flexible for replication operation but Scale Up is more cost effective
§ Best Practice: Allocate 10% of overall SharePoint Content or 300GB disk space for Tempdb database
§ Allocate separate and dedicate disk space for logs
§ Best practices for choosing RAID level:
o Use RAID 10; why??
§ Better redundancy
§ Faster and less impacting rebuilds
§ 2 * write performance
§ Optimised for IO operation
§ Disadvantages:
· Expensive
· Lower your overall disk capacity
§ Use RAID 5 when:
o Storing content
o Content is replicated
o SQL failure is automatic between content
o Issues with RAID 5:
§ Recovery takes longer
§ Slow for write operations
o Risky
§ Best practices for network bandwidth (Gigabit or better network)
§ Extra attention should be given to MySite. MySite takes more time to render than team site
§ Never program SharePoint database to use autogrow
§ 64-bit hardware for SQL Server is recommended
§ Use multiple data files for SharePoint database i.e. no. of data files = no. of CPU core
§ Defragment your databases regularly
§ Use differential backups
§ Don’t virtualise SQL Server
§ Ideally don’t exceed 5 web server per SQL instance
§ Scale SQL Server Out as you add more SharePoint servers
§ Prioritise your SQL Server Hardware in the following order:
o SQL Server à Index à Excel à Search à WFEs
§ Best practices for virtualisation
o Hardware guidance does not change in virtualisation
§ i.e. 4 processors physical = 4 processors virtual
§ 16GB RAM physical = 16GB RAM virtual
o Use Pass through or fixed VHD
o Don’t use dynamic disk in a production farm
o Network is tricky. Use multiple NICs and NIC teaming on the hosts
§ Isolate Shared Services Provider (SSP) under the following circumstances:
a) 10 million items indexed
b) Multiple farms consuming shared services
c) 100K user profiles + people search + my sites + significant use of audience
o Any combination of two or more from above are true
§ Index Server does not index all versions because you get search result of only latest content
Session: Best Practices for developing Custom Field Types (Presented by Todd Bleeker)
§ Custom Field Types do not work with datasheet view and MS Office application i.e. in Information panel
§ You must sign custom field type assembly and deploy to GAC
§ Naming Convention for custom field types:
o Field: [Purpose]Field.cs
o Control Class: [Purpose]FieldControl.cs
o Value Class: [Purpose]FieldValue.cs
o Field types_[Purpose].xml
§ Always use HTML Encode, when you render to prevent Script/SQL injection hacks
Notes from other sessions
§ Important tools to setup Kerberos Authentication
o Kebtray.exe
o Klist.exe
o Network Monitor 3.2
o ADSIEdit.msi
o Filldler Tool
§ Use Ken Schaefer’s Blog for information regarding IIS and Kerberos