So far I’ve let Rails and ActiveRecord rule the game. But I think
there’s some things I should change.
I have a record (called Tag) that is searched by using the default auto
incrementable Id that AR provides. On the Tag record I also keep a
unique identifier which is a string of 13 characters. That identifier is
really the Tag.
So my doubts are:
- Should I set the custom identifier as the primary key and remove the
- Or should I keep the default Id but instead fill it with the custom
- Would it make any difference when thinking of performance?
I’m currently adding some statistics record for each of those Tags. So
one tag “has_many” statistic records. And this statistics record has the
Tag identifier stored. That’s when I thought that the common key to tie
them together should be the custom identifier instead of the default id.
Any opinions? I hope I managed to explain my doubts.