Mentions on a page how to handle

A user can mention another user on my page.. That is he just writes something like hello @rohit.
So i need to save this comment in Database. If i save the exact comment "hello @rohit" the problem is that if the user changes its display name from rohit to rohit1 This wont get reflected on the page..
So i need to store hello someId  which corresponds to the user.. And while returning the response i need to replace the id's with the name.
Please suggest exact ways how i can accomplish this... As obviously in the above the user may actually type in hello someId and so there should not be any parsing.
I have one approach but dont know if its effecient or work well..
a cooment like hello @rohit  will go in the db like hello <user>id</user>
Basically we will use a xml tag . And also convert the rest of the string which is hello here... may be encode it so that it doesnt mix with xml...And then while returning the response we just parse the user tag and replace every id with name.

Please suggest pros and cons of the above. And any alternative ways.
Rohit BajajAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
it would be a bit risky if @rohit is a representation of user's display name instead of user's id. just imagine the situation where there are multiple users with same display name, which user id will be mapped?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.