Thursday, June 5
SQL Server Tips and Tricks for DBAs and Developers
The first session I attended on Thursday was a tip and tricks SQL Server one. The first tip was how to prevent accidental tables drop by using schema binding views. A schema binding view is linked to one or more table. This was, if you try to drop a table, SQL Server will complain, therefore rending accidental tables drop impossible (well, at least you’ll have a warning).
The second tip was about sort order. Sort order is set at the SQL Server installation where it will default to the one used by the OS it is about to be installed on. You can change it at database creation and table creation. But what if you want to specify a different sort order? Do you know that it’s possible to specify a sort order directly in a query?
The third tip was about constraints. The speaker told us not to use the No Check switch because it will slow queries. By using the With Check switch, SQL Server will validate all existing data as soon as you save the constraint.
The fourth tip was about raising errors. The speaker demonstrated that it was possible to send a localized friendly error message to the user. The language is set at the user’s creation.
The last tip was a set of very large databases backup best practices. Basically, the speaker told us to use file groups to help speed the backup process.
Developing and Operating ASP.NET Applications: A Case Study of www.asp.net
This was a very interesting session because the speaker is a member of the www.asp.net team and he had some real life stories and tips to speak about. He first told us a little about the site and listed some stats. The site is composed of more then 4,000 files, has more then 105,000 visits per day and more then 16GB is transferred each day.
At first, the hardware that ran the site consisted of a hardware load balancer, two dual Pentium 500MHZ processors Web servers and a dual Pentium 750MHZ processors SQL database server. As the site grew, the bottleneck appeared to be the database server. The problem was that the OS, the databases and the logs where located on the same disk and I/O was not good. The hardware was upgraded and the site now runs on two dual Pentium 2.2GHZ processors, 1GB RAM Web servers and a dual Pentium 2.8GHZ processors, 2GB SQL database server. The biggest difference is the way disks are setup on the database server. They are now using RAID 0 disks arrays with separate controller and arrays for the OS, the logs and the database. The Web servers at running at 5% utilization and the database server at about 6%.
The speaker mentioned the fact that the site was built by developers and that not being database experts, they made some database design mistakes at first. He recommended a very good book by Ken England published by Digital Press called Microsoft SQL Performance, Optimization and Tuning Handbook. He said that the book was targeted at developers. I’ll check to see if I can get my hand on one copy and review it for you at some point in my .NET book reviews column.
Here’s a list of a few recommendations he made during his talk:
-De-normalized the tables for better performance
-Understand clustered indexes
-Use separate SQL accounts for anonymous access and administrative access
-Do not use Ad-Hoc SQL queries. Use store procedures. This will help you prevent SQL injection attacks.
-Cache aggressively
-Use the DataReader instead of the DataSet
-Try returning multiple resultsets from a single store procedure instead of called multiple store procedures in the same method.
-Ensure all open connections are closed
-Read the white papers that the team wrote. You can download them form the www.asp.net Web site.
-Make sure you turn ViewState off if you don’t need it, this especially true for DataGrids.
-Set the maximum value of virtual memory (800MB) in the configuration settings of the Web application
One thing that surprised me was the fact they are using inline code instead of code-behind. The reason behind this is that if they make a change to a page, they just have to FTP the new version and there’s no application restart compared to compiling and updating the application DLL. Of course, most of the application is already coded in business objects. One note of interest, the business objects never return ADO.NET objects like DataReaders or DataSets; instead, the data is mapped to objects.
One last recommendation: include a robots.txt file in your Web application where you will list file that you want search crawlers to ignore. The speaker gave the example of Google that is crawling their site about one time per week. They were trying to pinpoint a peak in usage and they found that Google was indexing the forums and was following all the links. In the ASP.NET forums, all the posts are cross linked by users. By using that robots.txt file, they have basically told the crawlers to excluded the forums pages.
Bad Time Slot
No, it’s not the title of a TechEd session more what I experienced. I first attended a session targeted at network admins called Troubleshooting ASP>NET Applications on IIS 6 but when the speaker started analyzing memory dumps, I said that was too much for my little developers brain and left for another session.
The second session I tried was Building Web Sites That Take Advantage of Commerce Server 2002 Business Analytics and Preditor Services (what a name!). It was worse, the speaker had cute little dancing characters (à la Japanese) all around is PowerPoints, his laptop was not working so he couldn’t demo and show anything and he was boring. Now you know what I mean by bad time slot.
Architecture and Deployment of SharePoint Products and Technologies
This session focused on how to architect and plan the hardware for SharePoint Windows Services 2003 and SharePoint Portal Server 2003 and yes, it was better then the last two !
If you are not aware, SharePoint Windows Services 2003 will be available for free for Windows Server 2003. It is a set of technologies to create and connect workspaces or workgroups. SharePoint Portal Server 2003 is not a free product. It offer additional capabilities on top of SharePoint Windows Services (are you still me me?).
Both products are build on top of .NET, Windows Server 2003 and SQL Server. They support load balancing (SharePoint Portal 2001 couldn’t be load balanced). One nice feature in a Web farm is that the administration is done one one server and automatically replicated to the other servers in the farm. There’s a maximum of 10,000 workspaces that can be hosted on a single SQL Server box.
For demonstration purposes, the speakers had set up a network of five servers: two Web servers, a cluster of two database servers and a domain controller. The servers were ordinary Pentium 4 1.7 GHZ boxes and load testing using Application Center Test (included with the Enterprise version of Visual Studio.NET) gave an average of 55 requests per second out of this configuration. Not bad at all.
The speaker then showed how to configure SharePoint to have an internal site (inside the firewall) for the users connected to the corporate network and an external site (reachable form the Web) to point to the same site. Interesting indeed.
From what I’ve seen, SharePoint is vastly improved and I can’t wait to set a server at work to test SharePoint Windows Services.
Using MSDE in an ASP.NET or Visual Basic .NET Environment
For those who don’t know, MSDE stands for Microsoft Database Engine. It’s a free scaled down version of SQL Server 2000. It’s limited to 5 connections at a time and it does not come with an administration tool like SQL Server Enterprise Manager you can however manage it from Visual Studio.NET. The title of this talk was misleading as the speaker focused the strategies on how to deploy MSDE with your applications.
A new deployment kit was announced. The kit will be available in Beta soon and we should expect a release sometime this fall.
Here are a few highlights of this session:
-In your installer, use MSI files.
-Up to 16 instances of MSDE can be running at a time.
-Each instance requires 70MB of disk space and uses 7MB being idle.
-You must distribute all MSDE install files in your installation. This limits the deployments to CD based deployments.
Attendee Party
The attendee party was held at Dallas Fair Park. This National Historic Landmark has the largest collection of 1930s Art Deco exposition style architecture in the United States. It is simply stunning.
Microsoft used two gigantic buildings, one where you could find casino style entertainment and the other with modern type of entertainment. I walked through the casino and dozens of table were available to play blackjack, roulette and other styles of casino games. The other building had virtual reality games, bumper cars, a laser gun arena, arcade games and an Xbox section where you could play on plasma screens and on projection screens.
A TechEd party without bands is not a TechEd party. This year, top recording acts Smash Mouth and The Wallflowers appeared live on stage. Smash Mouth was…a smash with their mix of ska, punk, pop, dance, reggae music . This is a real party band and soon, people were body surfing, jumping, dancing, girls dancing on stage and even a few ladies showed theirs….Yes, crazy it was. The Wallflowers played next and people really enjoyed their show.
All this and of course, free food, free beer and lots of prizes (now I know it’s a real pattern!). Check the photos by clicking the picture archive link at the top of this page.
Friday, June 6
Enterprise Solution Patterns Using Microsoft .NET
The first session of the last day was an introduction to design patterns in .NET. Patterns help document simple mechanisms that work, provide a common vocabulary and help you reuse. Microsoft has published 27 patterns to date that you can find in the msdn.microsoft.com/practices Web site.
The speaker introduced what patterns are and explained some abstraction models. It was an informative introduction to patterns. I strongly encourage everyone to visit Microsoft’s patterns Web site and take a look at some of them. You can download them in PDF format. Some of them are also available from Microsoft Press.
Building High Performance Web Site Using Commerce Server 2002 and Content Management Server 2002
As if building a Web site with Commerce Server and Content Management Server wasn’t a daunting task, architecturing and planning is also a challenge. The speaker explained how to get the maximum performance from such a site. Here are some of the points he mentioned:
-MSIB has very good documentation on how to plan hardware.
-Get the best I/O by using RAID 10 or mirroring (not RAID 5).
-Get the best CPU possible for the Web servers. Commerce Server is a CPU hog.
-On Windows 2000, there’s no benefit of using a four processor server.
-The data warehouse server requires lots and lots of memory.
-Use Microsoft Operation Manager to monitor the site. MSIB 2.1 includes a management pack.
-Use output caching.
-Minimize the use of the content connector.
-Minimize the basket views.
-Try to reduce the page size and don’t use dozen of small images.
-Latency in the US network is about 60 milliseconds compared to 400 milliseconds overseas.
The speaker then explained that business people can’t understand why a high level Web site can cost so much. He said that by doing a transaction cost analysis (TCA), it was possible to determine the cost of a transaction. He showed an Excel template that Microsoft published to help people do TCAs. Lastly, he mentioned that the next Commerce Server service pack (available around October 2003) will allow developers to use Visual Studio .NET 2003.
Integrating Microsoft Content Management Server with SharePoint Technologies
My last TechEd 2003 session was one talking about the integration of two server products: Content Management Server 2002 and SharePoint Portal Server 2003. The integration will be possible by using the Content Integration Pack Version 3 that will be available at the end of 2003. The speakers demonstrated a very early build of the pack. They showed how to publish content from CMS to SharePoint, how to publish SharePoint content to CMS and how can SharePoint index CMS content.
The goal of the team behind the integration pack is to make the servers integration seamless as possible.
Interesting TechEd facts
For you who want more information on TechEd, I gathered here a few interesting facts.
TechEd 2003 is significantly larger than 2002, with approximately 9,000 attendees, a 29 percent increase over 2002. In the Expo Hall, there are 250 partners, up 47 percent from 2002.
TechEd 2003 features a huge jump in the number of sessions offered from 2002: there are 60 percent more sessions -- 417 this year compared to 260 in 2002. To accommodate the additional 150 sessions, TechEd is a day longer.
38% of the attendees are IT professionals, 21% are developers, 18% are architects, 13% are business professionals (such as trainers and consultants), and 9% are executive management.
The ratio of technical staff to attendee is 1 staff member to every 5 attendees! You find technical staff members speaking, proctoring the hands-on labs, and waiting to answer your questions in Ask the Experts.
It's 4:30 a.m. and275 tired caterers are converging on the Convention Center to start setting up for another day.
Start with 500 gallons of coffee. Add 4,200 Krispy Kreme donuts. And that was just Monday. TechEd food and beverage manager Jeri Dixon said 60,000 bottles of water and 40,000 cans of soda will get chugged this week. Those mountains of fruit? Almost 30,000 pieces will be consumed before Friday balanced out, so to speak, by 15,000 Twinkies and other snack items. If you're trying to watch your weight, you won't want to pick up one of the 10,500 candy bars that will be set out this week - or the 42,000 ice cream items.
Marveling at the size of the lunchroom? It's set to serve almost 8,000 - and can move through 5,000 people in the first 20 minutes. Finally, this last item probably won't surprise you: Dixon said TechEd attendees are well-known for their high caffeine consumption: huge quantities of coffee in the morning, equally hug quantities of drinks like Coke and Mountain Dew in the afternoon.
TechEd 2003 Highlights
For me the highlights were:
-Windows SharePoint Services because it is so easy to set and manage workgroups with it.
-SQL Server Reporting Services. Could writing reports be fun again (was ever it?)
-Olymars. Maybe too good to be true. I can’t wait to try it.
Final Impressions
I enjoyed giving you reports on the things I saw, experienced and learned at TechEd 2003. I hope you enjoyed them too. Again, thanks to Nurun for sending me to TechEd, Michel Fournier for letting publish this coverage and the Montreal Visual Studio User Group for lending me their laptop. I hope to see you in San Diego for TechEd 2004. In the meantime, the Microsoft Professional Developers Conference (PDC) will be held October 26 - 30 in Los Angeles, California.