News for hackers. Stuff that matters.
Re:Reddit's database has only two tables by jakejake on Monday September 03, 2012 @03:02AM (#4469405)
The main issue I run into with storing key/values in MySQL/Postgress is querying those values if they hold complex data (json, serialized data, etc) and the NoSQL products have features that let you dig into those meta fields when querying. (I haven't used a lot of NoSQL products yet, just dabbled with them)

Do you guys know of good techniques to do that with a traditional database like MySQL? I know MySQL has some XML parsing features if you store meta data as XML. I've experimented with it but never used it in production. I sometimes put JSON into a column for dynamic data. Usually I only do that for fields that I know won't need to be queried but that occasionally comes back to haunt me.

Re:Reddit's database has only two tables by gizzlon on Monday September 03, 2012 @03:29AM (#4469460)
Don't know for MySQL, but postgres just added some support for JSON in the latest (beta) versions. Haven't used it and I don't know what it's capable of..
Re:Reddit's database has only two tables by zxoq on Monday September 03, 2012 @04:22AM (#4469590)
The support for JSON is only validation, otherwise it's just like a plain text column.

A better choice would be to use a hstore column, which is sort of like JSON but we different syntax. Postgres supports indexing hstore subfields, querying on them etc.

Re:Reddit's database has only two tables by wisty on Monday September 03, 2012 @12:04PM (#4470797)
Postgres has XML, binary, JSON, geometry ...

And of course, hstore.

Re:Reddit's database has only two tables by masklinn on Monday September 03, 2012 @02:43PM (#4471359)
And array.