Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I need your opinion! I am creating a chat application for a large community of several million people. I need to find the best way to have a very good performance. I plan to store conversations in temporary text files, and when the chat is terminated, the system stores the conversation into a PostgreSQL DB and deletes the text file. There will be thousands of text files, and I am concerned with I/O overhead fron the HDDs. Maybe this won't be a problem if text files are stored in RAM while they are read/written. Do you know how Linux handles those files that are heavily read and written? Another way would be querying the DB directly but I would need a whole lot more hardware I guess.
What do you think is best to handle a lot of queries like this, and does Linux keep in RAM files that are heavily accessed (provided that there is enough RAM)?
For best performance in a large scale chat application, it's best not to even receive the chat messages in the first place. Is there some reason it's not acceptable to design it so the clients directly communicate with each other?
Even if you use centralized communications, why bother storing conversations at all? If you're going to be deleting them at the end, then obviously you're not concerned with long term storage.