[erlang-questions] Does erlang:now() guarantee that subsequent calls to this BIF returns continuously increasing values even in erlang cluster?

Michael Truog mjtruog@REDACTED
Mon Apr 20 09:33:24 CEST 2015


You might want to look at the v1 UUID as created by https://github.com/okeuday/uuid since the node id part of the v1 UUID is specific to both the Erlang node (including the MAC address) and the Erlang pid that created the UUID state. For time synchronization among nodes ntpd is normally used to minimize time differences, which then influences the time reported by erlang:now/0 and erlang:system_time/1.

On 04/19/2015 11:44 PM, Sergej Jurečko wrote:
>
> It does not guarantee unique values in cluster.
>
> Sergej
>
> On Apr 20, 2015 8:42 AM, "Daniel" <liudanking@REDACTED <mailto:liudanking@REDACTED>> wrote:
>
>     Hi, dear list,
>
>     I am looking for a global sequence generator in erlang cluster.
>
>     I think erlang:now() is promising, because it is fast enough and “also guarantees that subsequent calls to this BIF returns continuously increasing values”. But I am not quite sure whether this guarantee also works for erlang cluster which have several nodes running on different servers?
>
>     I have read Time and time correction in Erlang (http://www.erlang.org/doc/apps/erts/time_correction.html), but still have no conclusion.
>
>     Daniel Liu
>     _______________________________________________
>     erlang-questions mailing list
>     erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>     http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150420/f29be210/attachment.htm>


More information about the erlang-questions mailing list