3 ms·
By serialisation I meant something that dumps objects like Python's pickle. Maybe marshal is a better equivalent. If there was version checking as you say there
by josephlord 12y ago
By serialisation I meant something that dumps objects like Python's pickle. Maybe marshal is a better equivalent. If there was version checking as you say there is in marshal it would still have failed in production but the errors would be better.
Are you sure Activerecord uses YAML in the DB? Everything I've used it for is stored as the native database types. What is the need to serialize the object into the DB rather than create a new one based on the record in the DB?
Nowhere did I say serialisation was easy. My comment was that running multiple versions of platform and libraries at once sharing state was brave. To do that I would want to be completely explicit about the state format and have tests to ensure it is correct even though it is an internal API.
Better not to share anything between the servers and just have them all accessing the same service that owns the state format (probably the DB but possibly also caching layers[risky needs managing] and other services).
- byroot 12y ago> Are you sure Activerecord uses YAML in the DB ActiveRecord use YAML (by default) to serialize non scalar values like hashes and arrays.
- josephlord 12y agoOK, I don't actually use them, my data model is pretty pure relational (edit: and normalised) although I might start using the Postgres array and hstore/json column types at some point I guess that boundary would prevent serialization issues troubling me.
- jrochkind1 12y agoActiveRecord uses YAML if you tell it to serialize an object to a text column with the AR `serialize` feature. http://apidock.com/rails/ActiveRecord/AttributeMethods/Serialization/ClassMethods/serialize http://apidock.com/rails/ActiveRecord/AttributeMethods/Seria...