Database Schema Patterns

Database Design Patterns

Polymorphic Associations

This applied to concepts like tags, likes, votes… Think of actions you want to be able to apply to multiple models within your system. You want to comment on videos, and pictures, and chats. What are some ways to model this sort of relationship?

Postgres Strategies: https://stackoverflow.com/a/66126905

https://zenstack.dev/blog/polymorphism https://github.com/prisma/prisma/issues/1644

Primary Key Selection

See Primary Keys


Related Notes