Powered by

US - English
NEW! Silverlight 5 is available Learn More

Collection Hosting

By Microsoft Silverlight Team|July 18, 2011|Level 300 : Intermediate

Once a collection is built, it must be hosted on a server. This page contains information about the various ways to host collections in the following sections:

There are three primary types of collections:

  • Simple collections containing up to 3,000 items. In these collections, the user's experience is defined by previously generated (or static) XML.
  • Linked collections, generally containing several thousands of items. These collections consist of multiple inter-linked simple collections.
  • Just in Time collections, unbounded in size. In these collections, the user's experience is defined by XML generated dynamically in response to user action.

From the hosting perspective, simple and linked collections are the most straightforward, as they require only a static file server. Just in Time collections, on the other hand, require a more complex server structure for generating XML and image content on request. What follows is a brief description of how to host simple and linked collections, followed by in-depth discussion on the more complex hosting of Just in Time collections.

Simple and Linked Collections

Serving Files

Because simple and linked collections are static files, they can be hosted on a simple file server. On each request, the server sends the PivotViewer CXML or image files. In both simple and linked scenarios, the PivotViewer will only request one CXML at a time. The distinction between the two is only that in the linked scenario, a user may navigate between different CXML files via links in the info panel (see Collection XML Schema). As such, there is no special handling of linked collections on the server. The only potential difference is that the file server may need to host multiple CXMLs (one for each simple collection composing the linked collection).

See the following illustration of a static server:

Tips:

  • Due to the large amount of text common in some collections, server-side compression should be enabled and the CXML mime type should be set to "text/xml."
  • Server-side caching and CDNs can be leveraged to further optimize performance.
  • For tips on optimizing deployment of the large number of image files in a collection, see Collection Image Content.

When Is a Simple or Linked Collection Appropriate?

Due to their simplicity, simple and linked collections are significantly easier to create and host than Just in Time collections. If a data set is small (3000 items or less) and relatively static, it is probably most appropriate as a simple collection. As simple collections get larger, however, performance and bandwidth become limiting factors. These factors eventually provide an upper bound to the size of the collection.

One way to get around collection size limitation is to split a larger data set into a number of inter-linked simple collections, thus creating a linked collection. With linked collections, a large data set can be presented to the user in up to 3000 item segments. Navigation between these segments (each a simple collection) happens via the Link and Related Link facet types (see Collection XML Schema), or with item click-through links. If a data set numbers in the several to tens of thousands, is relatively static, and lends itself naturally to inter-linking between different parts, it is probably most appropriate as a linked collection.

While linked collections enable a larger data set to be represented, when they grow very large, their complexity can become problematic. Key difficulties encountered when creating linked collections of very large data sets include:

  • Storage - Large linked collections can result in very large numbers of image files. Due to likely overlaps among different segments of a linked collection, the number of image files can quickly multiply into the many millions.
  • Updates - If the collection content rarely changes, a large number of image files may not pose a major problem. The addition or removal of an item, however, often requires large portions of the Deep Zoom image tile pyramid to be regenerated (read more about Deep Zoom tile pyramids here: Collection Image Content). As a result, maintaining a large collection that needs to be updated frequently can be cumbersome.
  • User Experience – Great linked collections can be difficult to create when the data set at hand does not lend itself naturally to division into smaller segments. They are also limited in their ability to respond to un-anticipated queries, and do not naturally support search across their segments.

When these difficulties are encountered, Just in Time collections offer some solutions.

Just in Time Collections

Introduction

To support scenarios beyond those possible with linked collections, a Just in Time collection can be used.

Just in Time collections follow a similar sub-collection methodology to linked collections, but use a dynamic server structure to mitigate the issues raised in the previous section. In Just in Time collections, the CXML and corresponding Deep Zoom image collection is generated by a web server at request time. The following figure illustrates a sample architecture:

Although more complex to construct, Just in Time collections have the following advantages:

  • Storage & Updates - Because much of the CXML and image content is created at request time, file proliferation is less of an issue, and updates can be made by changing only a small number of files (or tables).
  • User Experience – With a more flexible structure, Just in Time collections enable scenarios such as search and serving of un-anticipated query patterns. Further, because the cost of duplicating items in various sub-collections is mitigated in this architecture, inter-linking between sub-collections can be much more complex.
  • Enabling Large Existing Data Stores – Many existing large data sets already have dynamic data stores and pipelines, which can be leveraged to present the data in the PivotViewer collection format.

Feedback

Join our technical discussion forum to interact directly with the PivotViewer community. We hope you’ll join this community and share your work.

Appendix: Tile Building Sample Code

For sample code illustrating how to create a tile builder, see "TileBuilder.cs" in the following zip file: PivotCollectionFiles.zip.

Microsoft Silverlight Team

By Microsoft Silverlight Team, Silverlight is a powerful development platform for creating engaging, interactive user experiences for Web, desktop, and mobile applications when online or offline.

Comments (0)