Serialization pitfalls
Moderator: General Moderators
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Serialization pitfalls
I love the idea of serializing objects, storing them on a database, then bringing them back to life. It seems a very convenient way, for instance, of storing application settings within an object, particularly as opposed to .ini files or XML: but are there performance or other issues to be wary of with this approach?
Re: Serialization pitfalls
One obvious problem: by storing a complex structure in a single field you're violating 1NF and prevent yourself from querying on particular values in that complex structure.
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: Serialization pitfalls
I see what you're saying, but in terms of facilitating a persistent object are there any other workable options?
Re: Serialization pitfalls
For arbitrary objects - no, not really (short of using document-oriented databases like CouchDB or MongoDB). However if you have a fixed object class you can use any of available ORM solutions to map objects to table rows (in the simplest case).
- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: Serialization pitfalls
Good advice as always, thanks.