Mehul Harry's DevExpress Blog

This Blog

News


Mehul Harry is the DevExpress Web Program Manager. Follow him on twitter: @Mehulharry

Subscribe (RSS, Email)

Archives

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

We are excited to announce that the DevExpress ASP.NET Office controls, Spreadsheet and RichEdit, are getting improved scalability support.

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

Starting with the v2017.2 release, we're providing a Community Technology Preview (CTP) that supports the following excellent features:

  • 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

In the v2017.2 release, 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 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

Published Nov 28 2017, 05:25 PM by
Bookmark and Share

Comments

No Comments

About Mehul Harry (DevExpress)

Mehul Harry is an ASP.NET technical evangelist at Developer Express. You can reach him directly at mharry@DevExpress.com. You can also follow him on Twitter: http://twitter.com/mehulharry
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners