I'm curious if relational DB is the way to go, if the current relationships in the diagram make sense, and whether it will bode well for coding.
-
Have you looked that the database relational for stackoverflow? How post and comments relationships are design? That will give you more ideas.– user12964Jul 4, 2015 at 16:28
-
No, I have not. Where can I locate that resource?– Joshua KemmererJul 4, 2015 at 16:42
-
data.stackexchange.com/stackoverflow/query/new shows the schema in table form on the right-hand side.– user12964Jul 4, 2015 at 16:46
-
That's aweseome; never knew about that. Thanks!– Joshua KemmererJul 4, 2015 at 16:50
Add a comment
|
1 Answer
A couple of cmments:
CommentReplies
seems to be implementing many-to-many. I would expect it to be one-to-many -- as in, each comment has one 'parent'. One-to-many does not need an extra table; you simply have parent_id
as a column in Comments
.
Consider using ENUM
datatype instead of adding a XxTypes
table.
-
Thanks, I think I was actually having an error relating to that many-to-many relationship when using the Forward Engineer tool to create the tables. Jul 4, 2015 at 16:49
-
I considered using the
ENUM
datatype, but komlenic.com/244/8-reasons-why-mysqls-enum-data-type-is-evil made me think makes me reconsider because my ENUMs wouldn't be set in stone, and are subject to change. Jul 4, 2015 at 16:55 -
Yes, there are tradeoffs between ENUM, normalization, and other techniques. (Hence, my use of the word "consider".) Jul 4, 2015 at 17:00
-
The "proof of the pudding" is whether the
SELECTs
can be written, and whether they run sufficiently fast when there is lots of data. Jul 4, 2015 at 17:01 -
I did indeed note the intelligent usage of the word "consider". Yes, performance is what I'm unsure about, but I guess time will have to tell. Jul 4, 2015 at 17:07