Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Saving the serialized byte array would <em>maybe</em> save space as you wouldn't have all of the meta data associated with table columns, headers, etc... Having said that, I don't know that there would be any noticeable difference in speed or storage space by saving the individual fields in columns in the database versus one column with the object bytes. If you're going to serialize it and save it, you might as well save it to a file and not use a database at all. Not to mention, as your objects and model change, loading older versions could be problematic. Maintainability would be a nightmare as well.</p> <p>Personally, I'd never save a serialized byte array of an object in a database unless there was a very specific business case or reason to do so. I'd just create the table, columns, and persist it that way using JDBC or your favorite persistenace framework (like Hibernate). Saving it as a serialized byte array only seems to limit what you can do with the data. If you don't want to create the database, tables, columns, etc... then consider just serializing it and writing to a file. That would probably save some space and time as you wouldn't have to maintain a database server. Granted, the more objects you have, the more files, and the harder it would be to search and query that data.</p> <p><em><strong>TL;DR:</em></strong> I'd just create the database tables for the data you're trying to save. I don't see any noticeable benefits from saving it in a database as a serialized byte array.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload