Melon NG
Melon NG

Reputation: 3004

Should I use an in-memory database in storing the chat logs?

I am a beginner in database. I learned about SQLite/SQL Server for little but know none about something like Redis.

Now I want to make a chatroom on a webpage. The program needs to get/set the chat logs to the database.

I asked my friends for help.

One of them said that I should use the Redis for it is an in-memory database that perfectly suits the situation where get/set frequently.

Another of them said that I should use a normal relational database(just as MySql) and set the cache for the data on the webpage.

I should decide one before I made the program while I don't know which one should I choose now.

What's more, there are almost one hundred thousand data get/set to the database.

Which database should I use? Would you please give me a suggestion? Thank you.

Upvotes: -1

Views: 257

Answers (1)

Abu Sufian
Abu Sufian

Reputation: 1054

It depends on your application category or size. If you need to analyse data or block something during chatting(say you don't want allow some content in your application) then you should use MySql database.

On the other hand if you just want to develop chat application where You just want to pass message with faster time then you can go for In-Memory database. But if you change device then you won't be able to view history but message passing will be faster.

But If you want to develop an application with good purpose and with good customer experience then you can use both In Memory and MySql both at a time. For passing message you will use In Memory solution and after a certain time you will sync your central database so that in future you will be able to analyse data and will be able to provide good customer experience. So in short, you can use both for your application.

Upvotes: 2

Related Questions