https://microcumul.us

Just chilling

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

help-circle





  • 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.













  • andrew@lemmy.stuart.funOPtolinuxmemes@lemmy.worldThe Sign
    link
    fedilink
    English
    arrow-up
    7
    ·
    6 months ago

    I think it was big for easy local dev setups in a VM. But I think docker has pretty much taken over a lot of those use cases since a build can happen in a container pretty trivially across platforms these days. Plus be ready to deploy with the same tools, which Vagrant didn’t cover.