News for hackers. Stuff that matters.
Re:Show HN: Gun database – 100k ops/sec in IE6 on 2GB Atom CPU by marknadal on Saturday December 24, 2016 @07:03PM (#13252173)
Lexical comparison is only used when 2 writes happen at the exact same time.

Yes, it is a very basic hybrid vector/lexical/timestamp CRDT. The naive-ness of it is also its power, because it has strong eventually consistent guarantees.

However, it is intended to be the base case. You can build your own custom CRDTs on top to handle more specific business logic. For instance adding a DAG, a ledger, a simple linked list, etc. gun's default algorithm is not a silver bullet but it does "just work" out of the box for many web cases. See more here: https://github.com/amark/gun/wiki/Conflict-Resolution-with-G... .

Please especially read about our CAP tradeoffs (see the sidebar on the wiki).

Finally, it should be noted that because gun uses a graph data structure, JSON.stringify only ever applies to atomic primitive values (not complex/compound objects). So it is safe to apply (it is NOT safe to apply to complex objects).

Re:Show HN: Gun database – 100k ops/sec in IE6 on 2GB Atom CPU by sagichmal on Saturday December 24, 2016 @07:08PM (#13252186)
> Lexical comparison is only used when 2 writes happen at the exact same time.

But you take time from the system. Your writes may converge, but to an nondeterministic state.

Re:Show HN: Gun database – 100k ops/sec in IE6 on 2GB Atom CPU by marknadal on Saturday December 24, 2016 @07:11PM (#13252193)
No, because we then offset it with a vector relative to the machine, even the great Kyle Kingsbury (Aphyr of Call Me Maybe Jepsen tests) tweeted about us about this fact (that we assume/treat time as being loose/unsafe): https://twitter.com/aphyr/status/646302398575587332 .