Overloading Attributes

2922779399_117cd3cf4d

The one thing that keeps coming back to bite us is when we use a single attribute to store information about two (or more) different aspects of an entity. We experienced such situation again yesterday on the case of URL of an article. One would think that URL of an article is just an URL, but in reality it indicates (at least) three separate aspects of an article. The first aspect is that URL represents unique identifier that we use to do article deduplication. The second aspect is that URL is shown to the user, so that he can decide whether to click on the link or not. The third aspect is that the user is redirected to the location of the URL. While these three aspects usually can be expressed with the same URL, many cases exists where it isn't so. For example, we strip away some parameters to improve performance of article deduplication. We also strip away parameters from URL before showing it to the user, but we do this in a slightly less aggressive way so that we don't break links. Finally, we shouldn't strip any parameters when redirecting because we could strip away some essential tracking codes or some other important parameter. It was this last case that bite us yesterday. We were stripping away URL parameters because of the deduplication, but we stripped away also tracking code of URLs of promoted content that our advertisers use to track performance of their campaigns. For now, we managed to solve this problem with a help from the Incredible If, but in the long run, the proper solution would be to separate different aspects and store them in a separate attributes.

Enhanced by Zemanta