I can relate so much, as I used to have this intense rivalry at school and it was quite evident to all the other schoolmates...to be totally honest though if I didn't have him to compete with I would not have been motivated enough to achieve 11A*s. Although we were good friends (sorta) and even though I did cry and have a breakdown when he was chosen as Head Boy over me, I really learnt that there will always be people better than you.
Me comparing myself with another isn't helping me, but using that comparison to fuel self-determination is extremely helpful. You know what, he may seem like your enemy, and perhaps in your competitive adolescent eyes, he is. But if you approach him and interact with him in a friendly way, this will become a motivating rivalry. Maybe you feel you can't match his calibre, but the better thing to do is learn from him. Talk to him and become friends - you're not going to lose anything after you'll gain a friend and some insight knowledge on how to achieve high. But ensure this friendship is more than just you competing with him because you can't bear the failure // People will see right past that.
Be genuine and keep working hard, after all, you must have your own standards and not be the perfectionist you are...its never going to end well if all you do is measure yourself against others. You are not them, and they are not you! I mean think about it, we could all moan about how we couldn't get to make an amazing company like Apple or Microsoft, we could moan about all the money that we don't have, despite working so hard. You HAVE to realise that life is unfair and that within that seemingly futile and worthless life, there is always hope of success.