Is there data or research on the tradeoffs associated with revealing how a student's grade on an assessment compares to the rest of the class?
If you Google something like "pros and cons of ranking students" or something similar you will find several websites and other resources that deal with this topic. 

Ranking students is common in education. The best examples are standardized tests that always include a percentile ranking (SAT, ACT, GRE, etc.). This is one form of norm-referencing, which is a common tool used in assessing. However, since standardized testing is nationwide, it is hard to be too competitive with the person sitting next to you during the exam, since you probably do not even know their name.

Within the classroom context, ranking could be detrimental if there is a higher consequence of the ranking. For example, only the top 20% will pass and the rest will fail. This could lead to some cutthroat behavior and really lead to a negative learning environment. If the ranking lacks deeper implications, students may not even pay attention to it.

In the end, whether or not to rank or not depends primarily on a person's philosophy of education. Some believe this is beneficial while other do not and there is empirical support for both positions. It is impossible to say that this should always be used or never be used.