Game of suspicion ahoy! For the first time ever, Game of Thrones has resorted to the hackneyed "murder mystery" genre, which I utterly love. The context around Westeros and King's Landing adds more spice to it, really. Notice how Jaime sprinted to Joffrey as if his own life depended on it - I can't imagine anyone in King's Landing is in any doubt as to who Joffrey's father was.
The more I think about it, the murder of Joffrey seems an act of such brazen insanity as to only be the product of a supremely unhinged and yet brutally sharp mind. It seems out of place for almost all characters below. But then again, history shows us that mad, crude gestures do happen from time to time.
Let me say that although Joffrey was an cruel tyrant and insufferable bore, I was hoping he'd live long enough to kill one of Cersei or Tywin, as much as I am a fan of the latter. Killing him off this early sets off a variety of consequences that take a bit of the sting out of Kings Landing, not least of all the question of what happens to Sansa Stark. With Joffrey around, there was a strong tension between key characters like Cersei, Jaime, Tywin, Margery and Sansa. With Joffrey gone, that changes everything in the immediate circle (if not the Kingdom exactly).
So, whodunit? Obviously, I have not read the books (5,000 pages?!)...anyway, I present the MURDER MYSTERY MATRIX!
From my 'analysis', it would look to be one of Olenna Tyrell, Tywin Lannister or Oberyn Martell, although it's hard to imagine Tywin having the motive, Olenna having the temperament and Martell the opportunity. What DOES tip the scales in the Martells' favour is the fact that Olenna Martell procured the food and drink, where it would've been easy to hide the poison. From Joffrey's face, it looked like it would be something that attacked the respiratory system pretty quickly (say, cyanide), which could be packed into a drink or cake. The thought of Margery marrying this monster may have pushed her over the edge on the day of the wedding, although knowing Olenna, she would've planned this atleast a day or 2 in advance (but not more than that as it would surely get out).
Margery Tyrrell can't possibly have wished for this - now she won't be Queen (unless she marries Tommen Lannister? Bit of an age gap). She seemed to have made peace with Joffrey.
Tywin is capable of more or less anything - he must have known that if Joffrey was such as pain at the age of 13, at 18 he would've been absolutely insufferable. There was almost certainly a ticking clock on when Joffrey would kill Tywin, in my mind. However, Tywin is also (a) not a cruel man and (b) discreet. This murder was both indiscreet and cruel.
Oberyn Martell clearly has the motive and killer instinct, but having just lectured the Lannisters on the treatment of children, it's hard to imagine such an honour-bound man doing the deed. Also, it just wasn't his style.
I've added Melisandre and Stannis because after the 'spirit' in the cave and Renly's murder, I'm just not sure what limits there are on what she's capable of - also, she's crazy enough to try anything. Seems unlikely but there is a bit of motive and definitely opportunity and temperament.
Poisoning has a long and convoluted history - Socrates, Napoleon and Mozart are just three of many who have died of poisoning (sometimes accidental). Lord Varys seems to be well versed in poison but I can't imagine him hving the temperament. One person I have left out is Maester Pycelle, because although he definitely has the poison knowledge, I can't imagine him having the temperament, not more than usual Joffrey-hating motive and hard to see opportunity.
Finally, I've added Littlefinger, Jaime and Cersei, although for various reasons, I just don't see it.