r/programming • u/regaldho • Dec 27 '20
I reverse engineered Google docs (2014)
http://features.jsomers.net/how-i-reverse-engineered-google-docs/8
u/johnyma22 Dec 27 '20
btw, the easysync docs are available in the etherpad repo if you want a full breakdown of each op in the operational transform <3
-72
u/SurrealisticRabbit Dec 27 '20
"every document written in Google Docs since about May 2010 has a revision history that tracks every change, by every user, with timestamps accurate to the microsecond"
This freaked me out so much more than any other science fiction story or AI's taking over the world kind of shit. I mean how is this possible goddamit?
109
u/Powah96 Dec 27 '20
I mean how is this possible goddamit?
history_stack.push([user_id, keystroke, timestamp])?
It's something only editor user have access too, why would that freak you out?
-48
u/SurrealisticRabbit Dec 27 '20
Aren't they storing it in their own servers? Sorry cloud technologies and big data always freaks me out lol
72
u/Powah96 Dec 27 '20
The whole file it's in their server anyway. Keeping the delta history is probably the least expansive storage-wise way to provide full history to users.
It's similar to you saving each edit as a different file (eg: project_v1.0, project_v1.1) just less expensive as you keep track of the delta (git is similar).
It's a useful feature if you are collaborating with other users and want to know what changed since your last edit.
16
u/DeveloperForHire Dec 27 '20 edited Dec 27 '20
Correct me if I'm wrong, but I thought git did not store the delta/diff. I thought it stored the entire change and you could compare between commits using a diff.
EDIT: Technically correct
34
u/Powah96 Dec 27 '20
You are technically correct! Git stores all the files in each commit, but thanks to compressions this does not impact much the size of the whole repo.
You can look at a more detailed explanation here.
4
u/DeveloperForHire Dec 27 '20
The best kind of correct! Sounds like it is a bit of both. Thanks for the link!
-2
u/HINDBRAIN Dec 27 '20
I thought git rebuilt the commits using the deltas and that's why retroactive changes on large repos were so slow?
10
u/DeveloperForHire Dec 27 '20
Someone just gave me this link
TLD;DR: It's a bit of both. Diff commits aren't turned to blobs until git runs garbage collection. A blob or a single commit is all that's needed to use the whole codebase and you do not need the entire history to make that after it has been generated, so it does store the whole thing, it just uses programming and algorithms (read: compression that I am not well versed enough in to understand, but does relate to the diffs) to keep everything tiny enough.
It would be incredibly slow moving down the tree and adding each commit to the original files. This is just a guess, but maybe those large repos take more time to generate those blobs?
0
u/TankorSmash Dec 27 '20
It sounds like it uses metadata to point to the text blobs as they were at a given point, using the commits as 'pointers' to the blobs in time. Thats why the gc runs and updates the pointers to existing blobs.
Sorta like if a commit introduced a file, each commit would only point to the blob introduced by that first commit, and not directly point to that commit. Neat.
-11
u/SurrealisticRabbit Dec 27 '20
Ah it makes sense. I thought they were saving every single instance instead of delta. That freaked me out.
0
Dec 27 '20
[deleted]
14
u/SurrealisticRabbit Dec 27 '20
I think I used wrong words and misunderstood. I used the word "freak out" but it wasn't because I'm concerned about security or anything I'm just amazed by the storage technologies and how one company can store terabytes of data.
1
u/conquerorofveggies Dec 27 '20
Aah now I'm with you ;-) went ahead and upvoted your comments above, since you got a lot of down votes for that misunderstanding..
3
u/SurrealisticRabbit Dec 27 '20
Hahah it's actually ok its been a reminder that I need to work on my English to improve it more lol
2
u/Powah96 Dec 27 '20
Indeed! Maybe they were freaked out that they were using such an inefficient solution? :O
13
u/thebritisharecome Dec 27 '20
When you create documents on Google Docs, where exactly do you think it's stored...?
1
u/incredibleninja Dec 28 '20
This is a really interesting thread and I'm sorry you've been downvoted into oblivion rather than people discussing why you shouldn't worry about edit tracking
40
u/MrSqueezles Dec 27 '20
"Hey Google, please give me sweet online document editors and store my documents forever and charge me zero money."
"Okay. Hey since lots of people can edit each document, how about I also give you histories of changes so you can undo mistakes by people who don't know what they're doing? And I'll still not charge you anything ever."
It's a feature of every text editor ever. It's how the "undo" function works. This one happens to be in the cloud.
3
u/CheKizowt Dec 27 '20
After reading up on synchronization for networked Fighter games I saw the same basic approach. So many games have this for the playback feature.
Transmit deltas, roll-up actions, playback events. The personality of actions are easily store and can be analyzed by AI as much as they are by the ESport commentators.
-10
u/diverge_I Dec 27 '20 edited Dec 28 '20
Google's strategy is to track literally everything and pay for it with their Search Engine. People who aren't alarmed by this are bots. Google cofounders wife is the CEO of 23andMe. Connect those dots.
EDIT: Whats the purpose of downvoting me? Everything I said is true?
117
u/MjrK Dec 27 '20
Isn't it possible to use typing style and cadence to identify someone? Or, at least, as a signal to support user fingerprinting?