Scalability of ASP.NET Office Controls - Azure, Web Gardens, Farms, & Cloud Support (CTP - v17.2)

ASP.NET Team Blog
28 November 2017

The DevExpress ASP.NET Office controls, Excel-inspired Web Spreadsheet and Word-inspired Web Rich Text Editor, are getting improved support to handle scalability and increased web server load.

Scalability is the capability of a system, network, or process to handle a growing amount of work, or its potential to be enlarged to accommodate that growth - Wikipedia

While this is a Community Technology Preview (CTP), we're interested in feedback from those of you planning to target scalable servers. We've included several features to help you:
  • Web Applications using these controls can be scaled (in/out) easily
  • "Sticky Session" / "Session Affinity" is not required, any load balancing is welcome
  • Microsoft Azure and any cloud computing platforms with IIS are supported
  • Web Farms and Web Gardens are now supported

Scalability issues are not a problem for most customers. If you're hosting your web application on a single server, then you've not faced any scalability issues. However, for those customers using web apps on scalable hardware then they will be happy to hear about the improved support.

What's the problem?

The ASP.NET Spreadsheet and RichEdit controls are large powerful controls that provide rich functionality. When you open and work on a document in these controls, we need to keep track of the state. Things like the document structures, etc.

Previously, the ASP.NET Spreadsheet and RichEdit controls kept their state of opened documents in the web server's memory (RAM). This approach has an advantage for performance because the parsed document structure was in memory and ready to process the user's requests. However, using RAM to keep state makes the web server stateful and therefore not easy to scale (in/out).

Initially, we came up with a solution for Microsoft Azure that implemented smart routing and used the "Sticky Session" / "Session Affinity" mode to route document-specific user requests exactly to that appropriate web server. Unfortunately, this solution was complex to setup and implement. It also required the "Sticky Session" / "Session Affinity" mode which made balancing the application load less effective. And because it was only available for Azure, it didn't solve other customers who hosted on other platforms like Amazon AWS.

A Better Solution

The ASP.NET Spreadsheet and RichEdit controls now support an important new mode that allows you to store the opened document states in external storage. This will provide great scalability benefits.

The new mode allows you to not have any state between requests and therefore provides for non-stateful web servers with our RichEdit and Spreadsheet controls. This allows you to host on multiple-server solutions like cloud, web farms, web gardens, etc.

So servers that have no state are treated equally and can process any request. This provides several benefits:

  • load balancers can effectively spread the workload among other “stateless” web server instances
  • another great benefit of external state storage is that your web servers can be rebooted/updated/removed with no additional code required to save (or rescue) the state (scale in)
  • new web servers can also be added on-demand and they start the same as any other web servers in the pool. Therefore they can start participating in the application request processing right away (scale out)

Who is it for?

This new scalability mode and solution is for those who are developing scalable application with DevExpress Office UI Controls. This new solution allows you to build applications that are hosted on top of cloud computing platforms (with IIS), Microsoft Web Farms, or Web Gardens.

Storage Options

The 'document states' can be stored externally in one of following storage containers:

  • MS SQL Server database
  • Redis in-memory data structure store

We chose the above two because of their popularity. Supporting a storage container requires us to create a special 'Document State Provider' interface. We published two such providers for Microsoft SQL Server and Redis respectively. And it's also possible to develop others providers to support more storage containers.

How to enable it?

To turn on the new feature, set the desired document provider in your project's Global.asax file:

void Application_Start(object sender, EventArgs e) {
    ...
    var provider = new DevExpress.Web.SqlOfficeStateProvider.SqlOfficeStateProvider(connectionString);
    // or
    //var provider = new DevExpress.Web.RedisOfficeStateProvider.RedisOfficeStateProvider(connectionString);
    
    DevExpress.Web.Office.DocumentManager.StateProvider = provider;
    ...
}

In the sample code above, the connectionString refers to the connection string for your storage.

GitHub Sample

To help you test this, we've created and published a sample repo on GitHub:

https://github.com/DevExpress/aspnet-office-solutions

This repo consist of several solutions and projects:

  • Document state providers:
    • RedisOfficeStateProvider - Redis using document state provider
    • SqlOfficeStateProvider - SQL Server using document state provider
  • New solutions examples for MS Azure (code is the same for Web Farms and Web Gardens):
    • Azure-SqlOfficeStateProvider-Starter - Azure solution example using the SqlOfficeStateProvider
    • Azure-RedisOfficeStateProvider-Starter - Azure solution example using the RedisOfficeStateProvider

In the same repo, you'll also find the previous solution with custom smart routing and Session Affinity:

  • Azure-SessionAffinity-Starter

Learn more details on the repo's Readme file.

Give Us Your Feedback

Your feedback will help us decide the future direction. Please take a minute to fill out this short four question survey about your plans for ASP.NET Core usage:

Are you excited by the DevExpress Office Controls support for scalability? Drop me a line below.

Thanks!

Email: mharry@devexpress.com

Twitter: @mehulharry

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.