I have always been curious as to how google solved the solution of real time collaboration in their google docs product where they allow multiple users to edit and read the same document in real time.

I believe this is very similar to the well known readers and writers problem.

In some of the solutions that i have seen, we would need a mutex of some kind whereby the writers will have exclusive lock to the document itself and readers will not be able to read the document at all.

But in the google docs case, it is quite interesting whereby another user can read the document in real time and two users can both edit the same document at the same time without any conflicts which is very impressive to me.

  • $\begingroup$ This is a question for Google. $\endgroup$ Oct 19, 2019 at 6:24

1 Answer 1


Note: there is no way to know how Google does it. All we can do is speculate based on whatever information is publicly available. If you want to know, you have to ask them, not us.

Google Docs' collaborative features are reportedly an offshoot of Google Wave. Google Wave, in turn, reportedly used Operational Transformation.

As a very high-level basic overview, the fundamental idea behind OT is that each collaborator has their own local copy of the document, and the editor infers an operational transformation based on the user's inputs. These transformations can be very simple (insert character x at position y) or more complex (perform an extract method refactoring of the second code block in method foo and name the resulting method bar).

These transformations are then broadcast to the other collaborators and applied to their respective copies.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.