Hacker News new | ask | show | jobs
by timwiseman 6083 days ago
Perhaps, but then perhaps a database is not the proper store for that at all, and a relational database almost certainly isn't.

If you really must do it via a relational database, you could use something equivalent to varbinary(max) to accept whatever stream of bits is sent in and then parse them out into something meaningful later (or just store it for the applications retrieval).

1 comments

X ∈ { database } does not imply X ∈ { sql database } or X ∈ { relational database }.

Even if your data is not a good fit for the relational model, it's often a good idea to rely on a database system offering features such as transactions, an ad-hoc query facility, enforcement of access permissions and update policies, replication/recovery, efficient I/O, etc.

All true and good points, but if you feel the need to say that perhaps I was not being clear enough.

1. In the situation described so far, a relational database is almost certainly not the optimum solution.

2. If you must use a relational database, you can mimic the ability to accept arbitrary input using something equivalent to Varbinary(max) columns.

3. A non-relational database may be the optimum solution in your particular case, but perhaps it is not. Before using some form of key-value store or object oriented database etc, think about non-database solutions. Depending on precise circumstances perhaps simply writing the input out to a file or into an ordered file directory structure is a better fit. It may or may not be depending on further details.