From: Chad Perrin Date: 2012-10-20T10:41:03+09:00 Subject: Re: database part of a desktop application On Fri, Oct 19, 2012 at 02:00:39PM +0900, Sebastjan H. wrote: > Chad Perrin wrote in post #1080198: > > On Wed, Oct 17, 2012 at 01:39:21PM +0900, sto.mar@web.de wrote: > >> >>using databases in ruby so I just need to know which option to choose > >> >that, you might look into SQLite. It seems unlikely, from what you've > >> >said, that you'd need much more than that. > >> > > >> > >> What about PStore or YAML::Store? > > > > Those should work just fine. > > Thank you all for suggestions, I've tried PStore and YAML::Store and > they work perfectly for my purpose. Is there any practical reason why > choose one over the other? And what about performance related to the > size of the database? PStore uses the Marshal format for storing data. YAML::Store uses the YAML format. The difference is that the Marshal format is binary (as opposed to text), and the YAML format is a hierarchical data structure format represented in plain text (and is thus human readable and writable). I would probably use YAML::STORE rather than PStore unless I had a specific reason to do otherwise for that reason; I consider human readability a positive feature, in part for purposes of making it easy to create more tools that are compatible with whatever software you're writing. Plain text is essentially the one and only universal data format, after all. Performance for large databases depends on your definition of "large". I would recommend not worrying about it too much unless you actually measure performance and find that it is unacceptable. I don't strictly agree that "premature optimization is the root of all evil", but it sure is at the root of a *lot* of evil in programming. -- Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]