Real-time co-authoring in the Excel Web App: Why and how we did it

What is real-time co-authoring?

You can check out all of the new real-time co-authoring features on SkyDrive and Office 365, but the biggest changes you’ll experience are:

  • Real-time presence. The ability to see what your collaborators have selected in the spreadsheet and if they’re currently editing a cell.
  • Real-time data. When someone changes the content, you see the new data immediately.
  • List of collaborators. At the top right of your screen, a list shows everyone working in the file and lets you click their name to jump to their location.

Figure 1: Real-time presence and co-authoring in Excel Web App.

Why we did it

We’ve heard feedback that customers would really like to see more collaboration features. We did some site visits, met at conferences, and invited people to visit the Microsoft office so we could observe how you use the Excel Web App to collaborate with each other. We found that one of the biggest challenges with collaboration was that it wasn’t easy to discover where other people were working in the workbook. Because of this, content would appear without any indication of the change. To provide a first-class collaboration experience, we knew we needed to solve this problem.

How we did it

To truly understand how co-authoring works today, we need to start with how it used to work. The Excel Web App has had co-authoring for many years, but it hasn’t been real-time. In the past, your browser would communicate with the server using a timer. Depending on how active you were in the spreadsheet, the browser would ask the server for updates anywhere from every few seconds to every few minutes. As a result, you would see the changes eventually, but there could be quite some time between when the other person updated the spreadsheet and when they appeared on your screen. If you were trying to work together with someone else, the speed of these updates just wasn’t fast enough.

Figure 2: Browsers used a timer and only received updates from the server when they asked for them.

To get us to real-time, we added a component on the server that sends notifications to all browsers connected to a workbook each time selection or content changes. This means whenever you type in a cell or move your selection rectangle to a different place, the server immediately sends an update to everyone, and their browsers immediately download the new information. You can think of it like a school ringing the lunch bell once the food is ready so that all of the students know to pick up their meals. This eliminates unnecessary server requests from the browser, since browsers don’t have to ask if there are changes when there aren’t any. It also greatly reduced the amount of time between the update making it to the server and everyone else receiving it, since browsers are notified immediately when a change is available. With these changes, the time it takes to see other collaborators’ updates decreased from 2-30 seconds to less than 1 second on average.

Figure 3: Browsers now get updates as soon as they are made since all of the browsers are always connected.

Optimizing the data transfer

In designing the model, we quickly realized that if everyone is active in the spreadsheet, we could be sending quite a bit of information over the network, resulting in slower connections and higher data plan costs. To remedy this, we send updates for only the things you need. We do this by having the browser tell the server what part of the workbook it’s looking at so that the server only sends down the relevant portion. For example, if I make a change on sheet1 while you are looking at sheet2, we wouldn’t send it to you unless you switch to sheet1. Additionally, we segment certain types of information so that if only a single thing changes, we don’t have to send the whole package again. A good example of this is selection: if there are 20 people in the workbook and only 1 person changes their selection, we send you that one person’s new location rather than resending all 20. The result is much less data over the wire, which means faster collaboration and better data plan usage for you.

Figure 4: Only the user in the middle received the change to A1 since the third user can’t even see it.

Leave a Reply

Your email address will not be published. Required fields are marked *