Jump to content

MySQL database traffic with php chat


bluetoother

Recommended Posts

iam aiming to add php Ajax chat in my web site ,,i use one database of 5 available by the hosting planand this chat system need 2 more tables in the databaseand these 2 tables will suffer from high trafficbecause chat clients will keep send Ajax requests every 5 secondsto get new posts in the chat table .i was thinking about creating another database for that 2 tablesso it can decrease load on the old main databasebut this will require reading from the 2 databases to get chat clients nameswhich stored in the databaseis it better to keep the new 2 tables in the main database to keep it fasthence i will keep running queries depending on the main Database and it will remain in server RAM and no other Database will reserve space in the RAM

Link to comment
Share on other sites

If you are already going to need to use one database, just put everything in there. That way you don't need to use 2 database connections on your pages, that will take up more resources then everything in one. It doesn't really decrease the load to move your tables into another database, the same database server is still doing all the work, it's still going to slow things down a little regardless of which database it has to look for the information. It would only speed things up if you moved your database to an entirely different server, like a database server that is dedicated to the chat application. That would keep your main server responsive enough where it's not tied up with chat traffic. But it's not going to speed up your main database if you move your chat to another database on the same server.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...