I have 2 years of work experience in the CS field and am now intending to apply for my masters. Since I am a bit nervous about contacting my manager for a LOR (since I am not sure of the consequences), I was thinking of asking a colleague in my team, who was my mentor. This person has seen my work from up close and hence would be able to write thoroughly about my qualities. However, the designation of this person is Senior Engineer (lower than that of team lead or manager). Would this be a significant reason to devalue the letter and should I instead go for a letter from my manager, notwithstanding the risks?
While a letter from the manager is probably a bit better, I doubt that the marginal difference is what will put you over the line for acceptance or hold you back. I assume that you have plenty of other aspects to your background that makes you suitable for the new degree. So make sure that your letters and CV stress those positive aspects.
However, if you are committed to leaving, then the reaction of your manager probably means less, as long as he/she is honorable. "Sorry to see this employee go" is a fairly good thing to see in a letter. But you have to judge the overall effect as you know the person.
Just make sure that everything else is enough to make you acceptable as a candidate. Then the letter from the colleague should be fine, and, as you say, they have better knowledge of your contributions.