I am setting up a database where you would have a parent level (lets say fruits) where you can put in comments/ratings and a lower level pages (apples, oranges) where you can also put comments/ratings.
What would be the advantages/disadvantages for two ways of setting up this data: one comment database with an identifier based on slug/url or multiple databases (CommentFruit, CommentApple, CommentCherry etc.)?
Thatâs a great question. Sometimes when we are starting out, it is easier to make a new thing for everything. Over time, however, it makes it hard to handle. I recommend your second option with one comment database with a type attached to it. That way it can grow with you by just creating a new type instead of another database. That is something I try to encourage my clients to do if they can understand it and if they are at the level where they are not confused by it.
Everyone is at different stages of learning. I try to encourage them to not get stuck but to keep going at whatever makes sense for them as long as it works. Later on, they can come back and spend the time to optimize it once they understand more advanced techniques.
If you use a different comment type for each, you wonât be able to reuse the same popups, or groups/repeating groups for basically displaying the same type of thing. It will just be a lot more work for yourself.
Yeah⌠thereâs no need to have multiple datatypes for each of the different types of comments⌠a comment is a comment, so a single datatype for âCommentâ is definitely the best way to approach this.
Thank you for your quick and thoughtfull comment!
I was also thinking the one database would be better maintainable!
I only would not know how to structure it by type therefore I was thinking of using the slugs.
Fruit could have hundreds of subtypes.
Just link the Comment to the parent object via a field of the relevant type.
You can also use an option set field of type, which can sometime help with searching/filtering etc. depending on your database structure and precise use-case.