https://microcumul.us

Just chilling

  • 5 Posts
  • 321 Comments
Joined 1 year ago
cake
Cake day: June 14th, 2023

help-circle
rss





  • andrewtomemes@lemmy.worldGreek letters too!
    link
    fedilink
    English
    6
    edit-2
    1 month ago

    This is true but it’s much easier to understand in retrospect unless you have a very very gifted math teacher (or series of teachers really) when you start learning it. For most people learning algebra it’s just another checkbox to tick for some reason. Plus pesky word problems that make you figure out the equations on top of that.

    Now that I’m an adult I recognize what all of this was trying to teach me. But back in my school days it was just another thing I had to do between hanging out with friends.










  • The real primary benefit of storing your relationships in a separate place is that it becomes a point of entry for scans or alterations instead of scanning all entries of one of the larger entity types. For example, “how many users have favorited movie X” is a query on one smaller table (and likely much better optimized on modern processor architectures) vs across all favorites of all users. And “movie x2 is deleted so let’s remove all references to it” is again a single table to alter.

    Another benefit regardless of language is normalization. You can keep your entities distinct, and can operate on only one of either. This matters a lot more the more relationships you have between instances of both entities. You could get away with your json array containing IDs of movies rather than storing the joins separately, but that still loses for efficiency when compared to a third relationship table.

    The biggest win for design is normalization. Store entities separately and updates or scans will require significantly less rewriting. And there are degrees of it, each with benefits and trade-offs.