How to save chat data?

I have a curious question ... I wanted to know how to maintain chat data in a database. I am using a php-mysql application that stores user chat data in a database.

Now my question is, if chat data grows, say, to several million records, how do I store it? Does mysql support it or does it have any limitations or load?

Take the gmail chat example. I can communicate without restrictions, and also receive all my previous chat data. How is this possible?

Can anyone answer this typical question of mine?

+4
source share
3 answers

MySQL will happily store millions, even billions, of records; but some numeric types will not be enough: see this for maxima of numeric types. As you can see, it would be better to use BIGINT UNSIGNED , for example. auto-increment fields.

Performance can be a problem for large tables, but it can be mainly solved using indexes (which means "I saw a performance drop somewhere around 100 GB in a similar situation").

+1
source

The chat history is actually not that hard. If I count about 100 bytes per message, 6 messages per minute and 5 hours a day (although this is very talkative chatter), constantly , as the worst case, which will give about 61 MB per user per year (!). This means that with 1 million chatty chatter ( very impossible) you will need about 58 TB or data storage.

Saying that this is the worst calculation, I would start with a maximum memory of 1 TB, set up a database and see how everything will be. It is very disadvantageous for a very young service to develop rapidly.

Also, I personally would not recommend using Windows for something like this if you don't know what you are doing. MySQL will store billions of records in the Debian distribution and will probably do it faster due to lower OS-level restrictions (see the MySQL documentation for details), and there should be a section on Windows restrictions).

+5
source

Google has a huge number of specialized repositories that it has developed for its requirements. I suggest you more specifically define your requirements and determine the right platform.

-1
source

All Articles