Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Why not just use a SQL db that handles json and stick everything in a couple columns?

Honest question: what's wrong with just defining a domain model, adopting an ORM and a serialization framework, and simply go with a conventional RDBMS? Afaik all reference web application frameworks handle this right out of the box.



Nothing on paper, if you get the schema more or less correctly the first time. The problem is when you need to do a schema change that affects terabytes of data down the road.


That is going to be a problem regardless of technology.

With an enforced schema you will at least know that all of the existing data matches the schema. Without it you have to hope that you had zero bugs while collecting the terabytes of data.


Yeah, but it's a different type of problem.

If you've a schema, you sometimes need to rewrite an entire table as part of a migration, and that can mean heavy engineering if you want to avoid downtime or disabling writes during the migration. There are 1:1 relationships between tables in the wild that wouldn't have passed a sniff test as part of an early schema design review, but then got created regardless to avoid a lengthy table rewrite.

If you've no schema proper, by contrast, you can manage multiple variations of what the data might look like in code. Not that such a thing is simple; it's definitely not, for the reason you raised. But it's simpler to deploy and migrate, or certainly might appear to be so to someone who isn't comfortable with SQL.

Also, there's a class of apps where having a schema doesn't add much value and NoSQL actually makes sense. Think storing and mining logs, scraped data, ML training sets, etc. -- apps where it doesn't matter much however a big pile of data gets stored, so long as you can shovel through it in parallel or store it very fast.


With almost any language, you can enforce schema via the “ORM”. Yes I know it’s not really an ORM but you get the point.


You just answered your own question. If I’m only working with objects, why wouldn’t I just store everything as objects?

And most ORMs suck outside of LINQ based ones since they aren’t a part of the language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: