Hi, Thats a really nice problem.
Max and Min are trivial. But the reset is probably not and can lead to some design decisions. When a replica does a reset it might be reasonable to restrict the reset to the values it has seen and not to other concurrent values it had not yet seen. A simpler LWW reset solution can probably be ok for some cases but a reset that makes sense causally is more demanding. Carlos ----- Carlos Baquero HASLab / INESC TEC & Universidade do Minho, Portugal c...@di.uminho.pt http://gsd.di.uminho.pt/cbm On 08/02/2014, at 23:27, Elias Levy wrote: > No, not a counter. An integer register that keeps either the minimum or the > maximum value ever assigned to it (there be two variants, one for minimum and > one for maximum). > > In our particularly use case we'd like to keep the earliest and latest > observed time of certain events, and it would be useful to be able to set > these values in a Riak map data type without first having to fetch the map, > compare the values in a register, and then write the map back. And doing > this is not equivalent, since the current register implementation is LWW, so > you are not guaranteed to actually end up with the minimum or maximum. > > > > On Sat, Feb 8, 2014 at 3:00 PM, Jason Campbell <xia...@xiaclo.net> wrote: > My understanding of what Elias wanted was a counter that simply stored the > minimum and maximum values it has ever reached, an optional reset would > probably be nice as well. It would be quite helpful when dealing with > statistics counters that can decrement. > > Then again, I could be wrong. > > ----- Original Message ----- > From: "Russell Brown" <russell.br...@me.com> > To: "Elias Levy" <fearsome.lucid...@gmail.com> > Cc: "riak-users" <riak-users@lists.basho.com> > Sent: Sunday, 9 February, 2014 9:53:42 AM > Subject: Re: Max/Min Integer CRDTs? > > Hi Elias, > > This is a great time for you to ask, if you’re asking what I think you’re > asking. > > On 8 Feb 2014, at 22:35, Elias Levy <fearsome.lucid...@gmail.com> wrote: > > > Does Basho have any plans for implementing a CRDT that maintains the > > minimum or maximum value for an integer? It would come in handy in our > > application and it would be very simple to implement. > > Do you mean some kind of bounded counter that cannot be incremented beyond > (say 1000), or decremented below a certain bound (i.e. non-negative counter?) > If so, then the plan is yes, but I’m not sure it is simple. If you have a > design for such a thing please share it. We’re working with a team from > Universidade Nova de Lisboa as part of the SyncFree project on this, but I’d > love to hear your ideas for an implementation. If you want to keep it private > feel free to email me off list. > > Cheers > > Russell > > > > > Elias Levy > > _______________________________________________ > > riak-users mailing list > > riak-users@lists.basho.com > > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com