From: Brian Candler Date: 2003-03-17T22:54:41+09:00 Subject: Re: ANN: Madeleine 0.1 On Mon, Mar 17, 2003 at 07:00:35AM +0900, Anders Bengtsson wrote: > This is the first release of Madeleine. Later releases will have > features like transparent command generation and clustering, but for > now the focus is a simple and well-designed implementation of the > basics. This is beautiful. Small suggestion: take class 'Marshal' as a parameter. Then you can choose a different Marshal-type class like 'YAML'. Although right now YAML is slow, this would give a language-independent database which you could even edit with 'vi' (great for data recovery). It might end up containing a lot of spaces, but it should gzip very well. Note to WHY: please can we have a YAML::dump(object [,IO]) method, for symmetry with Marshal? For testing I just replaced 'Marshal' with 'YAML', added the following: require 'yaml' module YAML def self.dump(obj,stream) stream.write(obj.to_yaml) end end This gives a database which looks like this: $ cat dictionary-base/000000000000000000001.snapshot --- !ruby/object:Dictionary data: foo: the opposite of bar bar: the opposite of foo and a logfile like this: $ cat dictionary-base/000000000000000000001.command_log --- !ruby/object:Addition key: baz value: the opposite of foobar Having such readable files could go a long way towards addressing the resistance which may arise towards treating your entire database of (say) a million customer records as a single opaque binary blob... Cheers, Brian. P.S. Another note to WHY: the last line of YAML output doesn't seem to contain a trailing newline, which is just a slight nuisance.