PHP Jquery的:聊天系统,究竟是什么了理想的框架?框架、理想、系统、PHP

2023-09-10 17:19:38 作者:假装没

我想实现一个聊天系统为我的网站。该功能将非常类似于Facebook的聊天。该聊天记录将是一对一的基础。

I want to implement a chat system for my site. The functionality will be very similar to facebook chat. The chats will be one to one based.

我知道如何使用PHP,MySQL和使用JQuery构建聊天系统。但我担心的是,它不会扩展到大量用户在长期的。

I know how to build the chat system using PHP, MySql and using JQuery. But my concern is that it won’t scale to large number of users in the long term.

使用jQuery我将作出请求每秒,以保持聊天窗口更新,或者如果用户发送的请求聊天的其他用户。这将导致服务器作为用户基础上增加额外的负载会增加加班

Using JQuery I would be making requests every second to keep the chat window updated or if the user is sending a request to chat with another user. This will cause extra load on the server as the user base will increase overtime.

使用PHP的,这不是一个理想的解决方案,那我应该看看彗星编程,这是我从来没有尝试过,我一直在说。

I’ve been told using PHP for this is not a ideal solution, that I should look into comet programming, which I never tried before.

我的问题是,是否有任何pre-构建框架在那里,我可以用,或建立它的一个更好的方法?

My question is that are there any pre-build frameworks out there that I could use, or a better approach of building it?

我听说NodeJs及APE,但这些都不是支​​持我的服务器。

I heard of NodeJs and APE but these are not supported by my server.

谢谢你们。

编辑:有我的服务器球员单词后,我可能会改变我的操作系统,所以我可以运行NodeJS。 如何好,是nodejs是可扩展性的用语,并就满足我的需求?

after having word with my server guys, i might change my OS so i can run NodeJS. How good is nodejs is term of scalability and will it meet my needs?

推荐答案

PHP和彗星并不是相互排斥的。彗星仅仅是服务器推送的技术,所以你不必不断轮询第二。您可以在PHP和放大器实现彗星; JS,它不是一个单独的编程语言

PHP and Comet are not mutually exclusive. Comet is just a technique of server push, so you don't have to poll ever second. You implement Comet in PHP & JS, it is not a separate programming language.

虽然:我不建议编程聊天你自己,除非你需要的非常具体的功能是耗时和容易出错使用pre-制的解决方案之一,例如:

Although: I DO NOT recommend programming chat on your own, unless you need very specific features. It is time consuming and error prone. Use one of the pre-made solution, for example:

http://www.phpfreechat.net/

或Java IRC聊天室。谷歌更多。

or java IRC chatroom. Google for more.