I am building a web chat application.
Chat.txt:
{
{
$USER_ID:1,
"TEXT":"Hello TOM!"
"TIME":$TIME_STAMP
},
{
$USER_ID:2,
"TEXT":"My name isn't TOM!"
"TIME":$TIME_STAMP
}
}
Obviously, i should not be storing the chat in a text file, like above. I should be using some sort of database technology like MySQL.
QUESTIONS: should i be using HTML5 to send and receive data from clients in a chat server that logs the history in a database? which would prevent multiple streams of continuous coections to my MySQL server?
Schematic:
->User 1 started chat
->Server start new chat server named "My Chat"
->User 1 coect to "My Chat"
->User 1 say: "Hello world!"
->Server log input
->User 2 coect to "My Chat"
->Server load "My Chat" history from MySQL
HTML5 websocket API https://www.w3.org/TR/2011/WD-websockets-20110419/
Conces: This doesn't actually relieve stress on my servers.
SERVER TECHNOLOGY: I will probably be programming the server in Python or C#. I have not decided yet. I would like some thoughts on that as well.
Amazon EC2 instance:
Ubuntu 14.04
Ram 8GB
FREE HDD 30GB
Note, since HTML5 is not cross-browser compatible with older browsers, i will do a fallback option to coecting to the MySQL server every 5 seconds.
- - , .
برچسب:
نویسنده: استخدام کار