I've been keeping up with this and I've come up with a hybrid solution.
I think the default Rails polymorphism functionality is very well suited for rapid prototyping. But for a long term solution, I've implemented by own polymorphic association using an intermediary table (e.g. Commentable
, Votable
). I can't find the post, but Bill Karwin points this method out in several answers on this site.
I don't plan on sharding, but if I did, I think Rails' default solution would be a good one.
I wrote my own Mixins to emulate the default Rails polymorphism functionality. It was a little tricky with foreign keys added in, or when adding the relationship after the table has been populated, but things seem to operate smoothly still.
Finally, my project will eventually have multiple services running analytics on an undetermined backend, most likely Java. Referential integrity aside, having a standard relational model is best suited for my needs.
In Short, I think it does depend, but in 90% of cases, having DB level integrity is best.