logoalt Hacker News

saghmtoday at 4:26 AM3 repliesview on HN

I'd argue that there's a schema; it's just defined dynamically by the queries themselves. Given how much of the industry seems fine with dynamic typing in languages, it's always been weird to me how diehard people seem to be about this with databases. There have been plenty of legitimate reasons to be skeptical of mongodb over the years (especially in the early days), but this one really isn't any more of a big deal than using Python or JavaScript.


Replies

morshu9001today at 4:40 AM

Yes there's a schema, but it's hard to maintain. You end up with 200 separate code locations rechecking that the data is in the expected shape. I've had to fix too many such messes at work after a project grinded to a halt. Ironically some people will do schemaless but use a statically typed lang for regular backend code, which doesn't buy you much. I'd totally do dynamic there. But DB schema is so little effort for the strong foundation it sets for your code.

Sometimes it comes from a misconception that your schema should never have to change as features are added, and so you need to cover all cases with 1-2 omni tables. Often named "node" and "edge."

show 2 replies
jeltztoday at 12:49 PM

As someone who has done a lot of Ruby coding I would say using a statically typed database is almost a must when using a dynamically type language. The database enforces the data model and the Ruby code was mostly just glue on top of that data model.

TZubiritoday at 9:50 AM

What's weird to me is when dynamic typers don't acknowledge the tradeoff of quality vs upfront work.

I never said mongodb was wrong in that post, I just said it accumulated tech debt.

Let's stop feeling attacked over the negatives of tradeoffs