[Developers] Unique timestamps?

Tim Sturge tsturge at metaweb.com
Fri Feb 1 21:23:37 UTC 2008


Yes; the timestamps of objects (that is the result of the "timestamp" 
field in)

[{ "id": null,
"timestamp": null
}]

are all unique; the subsecond fraction is more like a sequence number 
than an actual number of milliseconds.

If you're syncing with another database you might consider using the 
"guid" field

[{ "id": null,
"guid": null
}]

rather than the timestamp. This is designed to be a unique identifier 
for the object in freebase which is what a replication routine probably 
wants rather than relying on an implementation decision for timestamps.

Tim



Jonathan W. Lowe wrote:
> In coding a replication routine between Freebase and a remote database,
> I've been relying on the many timestamps associated with topics and
> links to order the processes, and have assumed that these timestamps are
> unique across all of Freebase.  So far, my routine hasn't encountered
> any instances of simultaneous events, but I'd like to turn my assumption
> into certainty.
>
> Seems like the answer has to be that all timestamps are forced to be
> unique in order to avoid transactional collisions. For instance, there
> must be some mechanism, even a random choice, that deals with the
> (however unlikely) scenario in which one user tries to adds a link to
> one topic at exactly the same instant another user unwittingly attempts
> to delete that same topic.  In such a scenario, would Freebase
> arbitrarily designate one of these two write queries as the first,
> perform its transaction, then evaluate the second write query based in
> part on the outcome of the chosen first query?
>
> There must be a clever MQL query that would answer this unique timestamp
> question.  If only I were a clever boy.  :(
>
> Thanks,
> Jonathan
>
> ----------------
> Jonathan W. Lowe
> Giswebsite LLP
> London, UK
> http://www.giswebsite.com
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>   



More information about the Developers mailing list