Analyzing Requirements and Defining Microsoft.NET Solution Architectures, Part X...

Creating the Physical Design (Deployment and Maintenance)


By: Chris Sully Date: August 28, 2005

Introduction

The aim of this series of articles is to provide an overview of issues surrounding the architecture of .NET Solutions. In doing so it is following Microsoft’s recommended approach and, in particular, looking at the requirements of the related Microsoft certification exam (70-300), which itself is one of the requirements for the MCSD .NET qualification. The main reference for this series of articles is the Que publication: 'Exam Cram2 .NET Solution Architectures'.

We’ve looked at the following thus far:

Article I: phase 1 of the process, the envisioning phase.

Article II: started on phase 2 (gathering and analysing requirements) focussing on business requirements.

Article III: continued with phase 2, focussing on user requirements and issues surrounding globalisation and localisation of your application.

Article IV: finished off phase 2, focussing on operational and infrastructure requirements

Article V: phase 3, developing specifications.

Article VI: phase 4, creating the conceptual design.

Article VII: phase 5, creating the logical design (application architecture).

Article VIII: phase 5, creating the logical design (logical data model)

Article IX: phase 6, creating the physical design.

In this article we continue our look at phase 6 with a look at the particular issues arising from a consideration of deployment and maintenance of the new system as well as a quick look at the physical data model, which should largely follow from the logical data model.

Creating the physical deployment design

Deployment

.NET offers XCOPY deployment for simple solutions. However, for more complex projects which employ the service layers discussed in earlier articles the ability to package these into deployable projects may become key to successful deployment. VS.NET is here to assist this process though a number of 3rd party tools are also available. There exist two overlapping areas: packaging the solution and distributing the solution.

Windows Installer is a built in installation program on Windows operating systems that maintains a database of registry and file information for every application installed. Windows Installer package .msi files are most commonly implemented with aid from Visual Studio .NET's setup and deployment projects.

VS.NET offers the following types of setup and deployment projects:

The standard setup projects and web setup projects offer a GUI to support the following:

Note that Windows Forms deployment has become simpler in .NET, now being easily achievable through HTTP thus providing easy deployment (including updates) but still with the rich client offline capabilities. The executable runs on the client machine in a sandbox satisfying security issues.

Licensing

Typically the licensing process involves the following: a caller requests a class, and the class validates the caller against keys stored in the binary file. .NET offers utilities to aid in validating and creating licensed assemblies. These include a class called LicenseManager that validates the client caller and the License Compiler (LC.exe), a command line utility to obtain runtime keys and store them in binary format for inclusion in the licensed assembly (something VS.NET will do automatically for you for classes marked with the LicenseProvider attribute). After a class has been marked for validation you call the static Validate() method of the LicenseManager class in the constructor of your licensed class. The validate method returns your license which should be saved to a member-level variable of type License.

More complex custom licensing may also be required, which can be implemented by inheriting from the LicenseProvider class and overriding the IsKeyValid() and GetLicense() methods.

Data migration

Often there will be data from existing systems to be migrated to the new. This is no great problem as long as the legacy system supports OLEDB. If large volumes of data are involved bandwidth consideration/ estimating the time for migration may become key.

SQLServer 2000 has two utilities for data transfer between data sources: Bulk Copy Utility (BCP) and Data Transformation Services (DTS). DTS is GUI driven, whilst BCP is command line, and DTS has database mapping transformation facilities and can save a package to run as a scheduled job. DTS is preferred in most situations. BCP is only really suitable when you have one table to copy and no data transformations are required.

Upgrading

Physical specifications should include an upgrade plan to apply bug fixes and enhance solution capabilities. When an upgrade takes place, you are usually faced with patching or reinstalling the application. VS.NET does not support patching but other Windows Installer platform tools, such as Orca.exe and MsiMSP.exe can produce patch files.

When multiple applications need to use different versions of the same assembly on the same server you should implement versioning. If the assembly is accessible globally through the GAC, a side-by-side versioning scheme is automatically applied.

No patching or repackaging is necessary when a web deployed Windows form executable is built to retrieve automatic updates from a web server and it knows:

The suggested 'no touch deployment' uses an asynchronous thread. Updates are automatically loaded when the application is initialised and the client is online. You could also use an asynchronous thread to check for updates and when one is found and downloaded repaint the screen. You may want this thread to be fired on an hourly basis, for example, on a timer.

Creating the physical design for maintenance

Through monitoring your application and determining potential trouble spots you can catch bugs before complaints start rolling in from clients. The maintenance plan should include reviewing errors found in the Windows event log/ whatever logging facility your app uses and raising red flags for any critical issues found.

You should also consider engaging in application monitoring to identify actual or potential performance issues. Monitoring in .NET is commonly implemented via Windows Management Instrumentation (WMI), which offers advanced and robust techniques supplied throughout the Windows platform.

An outline of the application monitoring process:

  1. Analysis – what do you want?
  2. Application instrumentation – expose the information you wish to monitor.
  3. Consider using supporting applications: Systems Management Server (SMS), Application Center service (AC), Microsoft Operations Manager (MOM) which offer built-in support for WMI, making integration easier.
  4. Manage the application monitoring process.

WMI is an implementation of the Web Based Enterprise Management (WBEM) initiative originally designed for C++ and VB development. WMI provides a standard means of accessing health and performance information from servers on a LAN, which is more convenient than accessing standard system APIs. WMI functionality is accessible through the System.Management namespace. All WMI classes inherit from the ManagementBaseObject class.

WMI exposes functionality in the following areas:

WMI can query via the following built-in providers to access provider specific health and maintenance information:

Creating the physical design for the data model

The logical design should transfer fairly smoothly to the physical with a couple of extra areas to consider further: indexing, partitioning and data denormalisation.

Indexing allows you to find records more quickly, as long as the indexes are thin and exact. Remember that insertion performance will be slowed by index maintenance operations. Columns used in common table joins are good candidates for indexing.

Indexes can be clustered or non-clustered. Clustered indexes are physically sorted by columns in a table and hence you can have only one clustered index. SQL Server automatically creates a clustered index on the primary key. Non-clustered indexes create a separate instance of the row based on the clustered column. A non-clustered index provides excellent benefits over a full table scan if the majority of queries contain a WHERE clause on the indexed column. However, they consume resources which must be considered.

SQL Server offers the Index tuning wizard which will recommend index placement, tuning the database to your specific queries.

Data can be partitioned into more manageable chunks to improve performance and/ or resource utilisation. Options are:

As discussed in the logical design section denormalisation can improve overall performance of your application and is commonly practiced in data warehousing and reporting databases.

Validate Your Physical Design

How are we doing against the PASS MADE criteria?

Performance

For users this equates to responsiveness, for which the following checks for appropriate usage are applicable:

Availability

Have you guaranteed availability by best practice design? Is the application reliable enough to be in a production environment? Implementation of the following will assist in meeting this goal:

Security

Have you secured the application against interception of data and user attacks? Does the application pose any security threats to your network? Implementation of the following will assist in minimising potential issues:

Scalability

What happens when you double the load? Identify bottlenecks in your application via load testing. Implementation of the following will assist in minimising potential issues:

Maintainability

Implementation of the following will assist in minimising potential issues:

Accessibility

Consideration of the following will assist in minimising potential issues:

Deployability

Have you documented a deployment plan? Is it as simple as possible with the least possibility for error? Consideration of the following will assist in minimising potential issues:

Extensibility

Have you considered how your solution will be extended in the future to support enhancements and bug fixes? Can you implement new functionality without breaking previous versions? Implementation of the following will assist in minimising potential issues:

Finally:

Next

We're not far from completing our run through of issues surrounding architecting .NET solutions. In the final couple of articles we'll take a step back from the phased approach to look at two areas that pervade the whole endeavour: standards and processes.

References

Exam Cram 2 .NET Solution Architectures
Cornish et al.
Que

http://msdn.microsoft.com/architecture/