I'm interested in canvasing opinion about options for Scala data-structure serialization. I'd like to find something which is developed enough to allow (if possible) efficient binary serialization of the Scala collection types (i.e. not using generic Java reflection - I don't want to be serializing all parts of a collection class, including internal book-keeping data) but also allows me to extend functionality for my own purposes/classes: I am more than happy to have to write serialization code for each of our own classes, but would rather not have to do it for collections from the Scala standard libraries. In C++ I get a lot of this functionality from the Boost serialization library.
I've used SBinary in the past and it does some of what I want, but is not getting obvious active maintenance and doesn't seem (afaik) to keep track of objects already serialized (e.g. for DAGs or cyclic datastructures).
Are there other Scala-specific solutions, or if not, what are your recommendations for efficient binary serialization?
Probably, if you only need to serialize data and not whole java objects, best solutions are :
I am using msgpack
and bson
in several projects and they work pretty well. I really recommend msgpack
– has most efficient binary representation (of these three) and is fully JSON compatibile.
A protocol buffers compiler for Scala: https://github.com/SandroGrzicic/ScalaBuff - perhaps this can help?
There's a couple of other links at the bottom of this page: http://doc.akka.io/docs/akka/snapshot/scala/serialization.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With