I have a question on best practice for relational databases and hierarchies. My question is, is it more sane to use text or int (id) based hierarchies?
I have a hierarchy, but it is not an id based one. The hierarchy is based on text e.g. 'level1', 'level2' as opposed to id1, id2
I use mysql and also solr for managing my data.
At the moment I have kept the text hierarchy, so could use that if I want to. But it seems healthier allround to create an id hierarchy (which I have also done). Int (id) hierarchies also seem faster and are not really prone to un-normalized data (I never have to trim() ids etc.)
Any thoughts on this are much appreciated. It would be interesting to find out what others feel is best practice.
Cheers
Ke