We actually use records and we include a version number in the record name 'foo-bar:0' that way we can easily match on them, and update them lazily. Concerning the usage of dicts, we are not sure if that's actually a good idea given that their representation doesn't seem to be stable across erlang runtime versions, please correct me if I am wrong.
Ali On Mon, Apr 26, 2010 at 9:39 PM, David Weldon <[email protected]> wrote: > Usually I'm all for records because of pattern matching and > compile-time checking. IMHO, broken upgrades are reason enough not to > use them directly for storage. I have yet to design a system where the > data structures never changed after the initial release. I hate to say > it but, for me, the answer may be to have functions which map between > records and orddicts/proplists. I guess this really isn't a > riak-specific issue, but its interesting to hear with other people > think about it. > > Dave > > On Mon, Apr 26, 2010 at 10:18 AM, Eric Cestari <[email protected]> wrote: >> >> Le 26 avr. 2010 à 15:10, Sean Cribbs a écrit : >> >>> Yes, the primary weakness of records would be upgrading them. You could do >>> it with a map-reduce job, but it would be better in general to use a more >>> fluid data structure. >>> >> In the defense of records : >> Records can be pattern matched whereas dicts and proplists can't. >> Using a record with dict attributes and single attributes for pattern >> matching ("state" attribute, or "type" ...) could be interesting. >> >> Eric >> >> http://twitter.com/cstar >> >> > > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > _______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
