Hacker News new | ask | show | jobs
by rebelidealist 4395 days ago
If you watched the talk, he explains the specific kinds of that should be stuffed into a JSON text column. It makes a difference.

This practice been done by many production sites over the years http://backchannel.org/blog/friendfeed-schemaless-mysql Might not be considered bad practice now.

2 comments

We actually use a storage format very similar to the FriendFeed schema in Dari. Dari is a open source Java persistence layer with a full query API that stores all it's data in a JSON blob in one table with a few extra tables for indexing the JSON data.

https://github.com/perfectsense/dari

Here is the SQL schema: https://github.com/perfectsense/dari/blob/master/db/src/main...

We've used this model for almost five years now with great success. It's simplified rolling out "schema changes" since no tables need to be changed. It's also been optimized to a point where it's extremely fast.

Well I'm saying it tongue in cheek. For a long time I and many others have stuffed JSON in SQL table columns, and I will continue to do so (heck, databases have started supporting JSON as a result).

But every time a developer sees an interesting twist on a piece of technology and goes for it, peers call it a bad practice.

I've been through many cycles like this, and inevitably some time passes, and one day you wake up to see yesterday's bad practices have turned into exciting advancements.

Moral of the story is, ignore the wisdom of the day and go for it, tiger. Stuff that JSON in an SQL table.

I'm not sure which authority gets to pronounce which code practices are good and which ones are bad (the Vatican?), but one thing that I've observed plainly is that this authority can't make up its mind and contradicts itself with regularity. My thoughts are that the whole project of trying to decide for each possible snippet of code whether it is good or bad is foolish and will never succeed. The fact is that everything in programming is a trade-off. Being able to make decisions that don't lead to disaster comes down to experience and wisdom.