聊天应用程序的潜在问题[关闭]

I am making a site where users will be able to chat with each other in person-to-person chats and group chats like on facebook, and I would like to ask a few questions before I actually dig in and start coding.

I thought about creating the chat application with javascript, ajax and php, and the conversations will be saved with mysql (PDO with prepared statements connecting to the database). Are these good for doing an application like this, or are there some languages more fitting for this?

Secondly, I fear that if many users would be logged in at the same time, it would make the site slower. Is mySQL really a good RDBMS when there are many users on a site, and are there some methods like PDO but that are intended to do querys faster?

Your suggested solution with AJAX, PHP, MySQL and PDO is totally fine (as Michael Rice already said). But if you want a real chat that updates immediately, the disadvantage is that you need to constantly poll from the server (via ajax). Maybe you could take a look at WebSockets (link to js api spec, link to protocol spec). That would allow you to instantly update when a user says something in the chat. Then you would not even need to store the conversation server-side!

You're putting the horse before the cart. If you build the product you can always tune for performance latter. Don't worry about optimizing before you've written any code.

I can tell you, many have come before you use these exact technologies.

MySQL is a fantastic DB. It's fast (when used properly), ACID compliant (when used with INNODB engine). PHP is a great, easy language. Javascript is the de-facto web language.

PDO is very fast, and prepared statements will help minimize SQL injections.

I think you are on the right path.