IMPORTANT: Please read our Guide To Quality Writing before you begin posting!

Dismiss Notice
Please note that we are only approving writers from the US, UK and Canada at this time.

Best way to make a chat

Discussion in 'Programming' started by iajua, Apr 20, 2015.

  1. iajua

    iajua New Member

    Joined:
    Apr 20, 2015
    Posts:
    11
    Likes Received:
    0
    Gender:
    Male
    Hi all,

    I have recently developed a website where i created a custom chat, where there is a main chat room and then the ability to click on an user to chat privately.

    I did it in the most simple way, with short polling, making ajax requests every 1-2 seconds to update the last activity date for keeping track of online users and to get the latest users in the chat room and the latest messages. It is done in PHP+MySQL.

    This is definitely not the best way to do it and i know that, it was just my first chat app and i wanted to get it done asap with my current knowledge.

    Now lets say the site will be having a few hundreds or even thousands of users at the same time, that would have a big impact to the MySQL, right?

    Would there be any server that is not too expensive and that could support such amount of users?

    Would you suggest of doing long polling? Or would that not be enough either?

    Or would i need to use some other technology much better for this kind of apps, like NodeJS + MongoDB?

    Looking forward to your suggestions.
     

Share This Page