dewyze
dewyze

Reputation: 979

Is storing XML/JSON in a MySQL Column ALWAYS bad?

I have an event organizer where a user can create one or several custom excel-like spreadsheets associated with an event. The event will also have some notes, and dates, and other basic info that fits well into a SQL databse. Obviously, I can't create a table for each user's spreadsheet. The data in the spreadsheet will NOT have to relate to anything in the database. The sheet itself will relate to the user and the event, but the data inside is self-contained with no strict data types.

Upvotes: 2

Views: 2914

Answers (2)

ReadWriteCode
ReadWriteCode

Reputation: 664

If you can install software, install a NoSQL DB for storing XML/JSON. e.g. Cassandra, MongoDB, Redis

They are better to handle that sort of access. Pretty much anything you need to store a blob, you are better off storing it in something other than MySQL since MySQL is not optimised as a key/value store.

Upvotes: 1

Sergio Tulentsev
Sergio Tulentsev

Reputation: 230346

Well, it's not necessarily bad. It's just that when you store a blob of XML or JSON to a field, you can't do anything to it, except for reading and overwriting. No queries, joins, grouping on items within this blob.

If you're fine with this and you do all your processing in the app anyway, then go ahead, store XML in the database.

Upvotes: 4

Related Questions