Login

Snippets by rspeer

Snippet List

Improved YAML serializer for large databases

I needed the ability to serialize and deserialize my database, which contains millions of objects. The existing XML serializer encountered spurious parse errors; the JSON serializer failed to handle UTF-8 even when it was asked to; and both the JSON and YAML serializers tried to keep all the representations in memory simultaneously. This custom serializer is the only one that has done the job. It uses YAML's "stream of documents" model so that it can successfully serialize and deserialize large databases.

  • serialize
  • database
  • yaml
Read More

rspeer has posted 1 snippet.