Re:Pstore: Ruby Built-In Hash Persistence
by 3pt14159 on Thursday September 22, 2022 @05:04PM
(#32944613)
The problem with YAML is that meaningful whitespace means that the size grows quickly for highly nested documents. I don't love XML, but there is a reason I recommended Ox. I've used it for real projects and it never fell over like so many of the alternatives I've tried where databases were not in the cards.
Re:Pstore: Ruby Built-In Hash Persistence
by fny on Thursday September 22, 2022 @08:58PM
(#32946654)
The problem with XML is that angle bracket expressions take up too much space because you need to duplicate element names. I don't love JSON, but there is a reason I recommend OJ.
...
The problem with JSON is that the keys take up too much space because they are duplicated. I don't love BSON, but there's a reason why I recommend bson-ruby.
And I could keep going... ;)
The benefit of using YAML is precisely that there's meaningful whitespace. Different strokes for different folks.
I even created a little gem when I was starting with Ruby, 10 years ago, that was a very thin wrapper around it so that I could play around using an ActiveRecord like syntax (https://github.com/brunnogomes/active_yaml). I used in some pet projects so I could do stuff like:
And have access to the data directly in the YAML files.Good times!