For anyone who is storing people in memory places, or for people who struggle with names/faces.

My interpretation of the mind palace scene...

And what it says about who’s in Sherlock’s mind palace, and what they represent. 

  • Molly represents Data. Although Sherlock is a chemist, it’s Molly who he turns to most frequently for scientific facts. In the moments after he’s shot, Sherlock needs to understand what’s going on with his body. Molly is a coroner, and knows better than anyone else the cold, hard effects of a bullet to the chest. 
  • Mycroft is Reason. As established in The Sign of Three, he’s there to help prompt and guide Sherlock on how to coalesce the facts he already knows into a pattern, and therefore predict and control outcomes. Molly tells Sherlock that his body is going into shock? Mycroft prompts him with the solution (don’t go into shock by finding a source of comfort, i.e Redbeard). 
  • Anderson is a Greek Chorus. He’s an annoying intrusion, but he helps to support and repeat the facts. His and Molly’s real world professions (coroner/forensics expert) mirroring each other no doubt linked them together in Sherlock’s mind.
  • Moriarty is Pain and Death. When Sherlock cannot handle the physical pain, he consults his mind’s source of pain. That source is the thing hidden away which tells Sherlock that death is preferable and comfortable, a place without pain where no one will bother him ever again. 
  • John is Love. Sherlock’s mind knows that people will be saddened at his death (Mrs. Hudson and his parents are named specifically, but also Mycroft, Molly, Lestrade et al. can be added to the list). However, it’s not the thought of saddening them or even John that causes Sherlock to fight. It’s the realization that John might be in danger, that Sherlock would fail him. It’s not dying again that shakes Sherlock, it's not being able to protect John. 

JOHN : Oh, his mind palace. It’s a memory technique – a sort of mental map. You plot a map with a location – it doesn’t have to be a real place – and then you deposit memories there that … Theoretically, you can never forget anything; all you have to do is find your way back to it.
STAPLETON : So this imaginary location can be anything – a house or a street.
JOHN : Yeah.
STAPLETON : But he said “palace”. He said it was a palace.
JOHN : Yeah, well, he would, wouldn’t he?