From: Brian Candler Date: 2008-10-07T03:24:04+09:00 Subject: Re: Object Persistence for a MUD Jeff Moore wrote: > At this point, I'm generating the static part of the universe and > Marshaling it to file so it can be re-used. Some would argue with > Marshal as a choice but I'm using DRb between clients and servers and > Marshal is the default object protocol within DRb so in for a penny, in > for a pound as they say... > > On the plus side, it's considerably faster than YAML or a database. > > On the minus side but isn't readable or mindful changes in object > version. If you've modified the object definition between store and > load, you need to rebuild. This is the reason I've relegated it to > managing static data only. > > The dynamic/stateful part looks like it's going to require a database of > some sort largely to provide a relatively stable/secure repository. You might want to have a look at Madeleine, which could be a suitable half-way house: it uses a Marshal (or YAML) dump as a snapshot of your universe, plus incremental transactions for updates. At startup it reads in the last snapshot plus the intervening transactions. This means you only have to write out a full snapshot occasionally. The code is also small and simple enough to be easily understood. -- Posted via http://www.ruby-forum.com/.