English 中文(简体)
基于时间组合的弊端是什么?
原标题:What are common pitfalls of timestamp based syncing?

我正在执行我的第一份综合法典。 在我的案件中,每个用户将拥有2类SOS客户,这些用户将使用<条码>终端Synctimestamp向服务器提供合成记录,这是代表最后合成物的微秒中的“Unix epoch”的64个轨道分类。 记录可在服务器或客户上随时制作,记录作为吉斯提尔角交换。

我对冲突没有担忧,因为几乎没有更新,而且总是来自同一个用户。 然而,我很想知道,是否有共同的东西,我需要知道,这可能与假日储蓄时间的辛迪加、与他人相冲突的辛迪,或其他 go。

我知道, g和其他一些版本的管制制度避开对内容谈判辛迪加办法的 time。 我也可以想象一下,如果使用<代码>uuid或hash,那么,同侪都宣布他们拥有哪些物体,然后交换这些物体,直到同龄人有相同的设备。

如果任何人都知道基于内容的辛迪加和基于时间的辛迪加的总体好处或劣势,那也会有帮助。

Edit——这里是我为时装和内容提要而介绍的一些好处/缺点。 请提出异议/更正。

- 我将内容提要定义为对两套物体进行简单谈判,例如,如果你给两套相同的基球卡的每一部分 j,则如何交换卡片,并告诉他们,在两套相同的板块之前,他们通过自己宣布并交出发现的任何复制件。

  • Johnny - "I got this card."
  • Davey - "I got this bunch of cards. Give me that card."
  • Johnny - "Here is your card. Gimme that bunch of cards."
  • Davey - "Here are your bunch of cards."
  • ....
  • Both - "We are done"

www.un.org/Depts/DGACM/index_spanish.htm 以时间为基础的合成优点

  • Easy to implement
  • Single property used for syncing.

http://www.ohchr.org。

  • Time is a relative concept to the observer and different machine s clocks can be out of sync. There are a couple ways to solve this. Generate timestamp on a single machine, which doesn t scale well and represents a single point of failure. Or use logical clocks such as vector clocks. For the average developer building their own system, vector clocks might be too complex to implement.
  • Timestamp based syncing works for client to master syncing but doesn t work as well for peer to peer syncing or where syncing can occur with 2 masters.
  • Single point of failure, whatever generates the timestamp.
  • Time is not really related to the content of what is being synced.

www.un.org/Depts/DGACM/index_spanish.htm 内容提要

  • No per peer timestamp needs to be maintained. 2 peers can start a sync session and start syncing based on the content.
  • Well defined endpoint to sync - when both parties have identical sets.
  • Allows a peer to peer architecture, where any peer can act as client or server, providing they can host an HTTP server.
  • Sync works with the content of the sets, not with an abstract concept time.
  • Since sync is built around content, sync can be used to do content verification if desired. E.g. a SHA-1 hash can be computed on the content and used as the uuid. It can be compared to what is sent during syncing.
  • Even further, SHA-1 hashes can be based on previous hashes to maintain a consistent history of content.

<>内容提要>

  • Extra properties on your objects may be needed to implement.
  • More logic on both sides compared to timestamp based syncing.
  • Slightly more chatty protocol (this could be tuned by syncing content in clusters).
最佳回答

我不知道这是否适用于你的环境,但你可能认为什么时间是“权利”、客户或服务器(甚至情况如何)? 如果所有客户和所有服务器都不在同一时间来源内,用户在使用客户“现在”时间与(或)服务器进行合并时可能会取得意外结果。

几年前,我们的发展组织实际上遇到了一些问题。 开发机并不是所有合成机都与SCM所居住的服务器相同(而且可能不是任何时间来源的合成机),因此开发机机机的机时时间可能漂移。 一台开发机在几个月后可停用几分钟。 我不回顾所有问题,但似乎建筑过程试图从某个时候(最后一个建筑)修改所有档案。 从最后的建筑开始,档案本来可以检查,因为最后的建筑已经发生了(从客户那里)的修改时间。

也许我们的SCM程序并不好,或者我们的SCM系统或建筑过程不适当地容易受这一问题的影响。 即便在今天,我们的所有开发机器都应与拥有我们SCM系统的服务器同步。

几年前,情况再次如此,我可以回顾一下细节,但我要提到,在你看来,情况是巨大的。

问题回答

问题的一部分是时间不是绝对的概念。 无论在什么东西之前或之后发生的事情,都是一种观点,而不是遵守隔离墙。

http://en.wikipedia.org/wiki/Relatative_of_simultaneity>relatative of simultaneity ,以了解为何人们停止利用隔离墙时间将这些事情推向外,并转向使用

如果你想用一个锁子实现同步,一个符合逻辑的锁定将最适合你。 您将避免一切lock辛问题和 st。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签