[Google Doc] Client-server Model

Could you help to clarify?

  1. How to decide the use change is completed and save as new version? User could add 1000 character in 3 hours, Will new version based on each new char, new paragraph, sleep time > x mins ( maybe it is better by gap/sleep time > certain period) ?
  2. Should the DB to store the document version use SQL DB?

每次客户端会发送一个或多个更新(比如加数个字节)到服务器,服务器将这个请求合并完当前服务器版本后就生成一个新版本。客户端每次都是等服务器返回请求之后再发送下一个请求,所以请求与请求之间的间隔不一定是等长的。

是使用 SQL,保持各个副本间的高一致性。

1赞

Thanks for reply.

For new version in server, for the following few use cases, will it create 1 version or multiple version based on change frequecy?
User added 1000 letters,
– 5 letters each second,
— 1 letter each second
— 1 letter each minute
– 1 letter each 10 minute

Does it based on time gap to group the change to avoid too many version ? Or need only create the new version when user click save, or logout?

Thanks

版本数量不只跟更新频率有关,就像我前面回答里指出的。

如果认为服务器处理速度很快,1s 会完成一次 round trip。那么,5letter/s 和 1letter/s 都会每秒发送(使得延迟保持在较低水平),这时候5个字母的更新会合并成一个版本。1 letter/m 或者 1 letter/10min 就会分别一分钟和十分钟一次。

不是的,Google Doc 是实时保存的。

1赞