Database Denormalization? : <p>Just to provide some context, I am working on a realtime chat application using Pusher(Websocket Service over cloud), where each messaged is logged in my server before it is pushed to the websocket server which in turn pushes the data to the client.So I am using a MySQL for storing the messages.</p>

<p>So one such table is my messages, which has the following fields <code>id,chat_payload,message_time,user_id,room_id</code>.</p>

<p>For populating the initial chatroom I would need to retrieve the message history, wherein each message object would include the <code>username,useravatar,chat_payload,timestamp</code>.But the <code>useravatar,username</code> is stored in <code>users, user_meta</code> tables respectively.So fetching the data on the run using joins clearly seems expensive since <code>user_meta</code> table grows very <a href="https://codex.wordpress.org/Database_Description" rel="nofollow">fast</a>.And clearly storing username,useravatar in <code>messages</code> table doesn't seem right as it would pose updation problems.</p>

<p>So considering the above scenario could anyone please suggest an appropriate DB/Application Design for the same? </p>
