A
A
Artem2013-01-27 14:53:59
PHP
Artem, 2013-01-27 14:53:59

Database choice: MySQL vs MongoDB?

There is a PHP/MySQL script. It is accessed by the application requesting data. Contacted frequently... Therefore, there is a desire to use PHPDaemon and send messages to these applications as they arrive. To do this, inside the script, I plan to add these messages to a separate table (it turns out a queue) and then read this table from PHPDaemon once per second, sending messages. And here the question arises: at the office. PHPDaemon's site recommended MongoDB. It seems to be more productive than MySQL. But is it worth it for me to add another daemon (MongoDB) to the system for this and work with not one, but two databases inside the script? Maybe just use the same MySQL?
The queue is unlikely to have time to swell up to at least a few dozen messages. Although MySQL is quite actively used at the moment.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vladimir Sokolovsky, 2013-01-28
@bartwell

How complex is the data schema? Maybe even use a simple key-value store like Redis ?

M
Maxim Klyushkov, 2013-01-27
@m_klyushkov

If MySQL copes, then why change anything? Tuned MySQL will perform better than MongoDB with default settings.

A
Alexander, 2013-01-27
@kryoz

As far as I know, MySQL is more productive than MongoDB on simple data structures. The meaning of MongoDB is only schemaless at the database level, which, however, does not cancel some semblance of schemas at the application level. And sometimes it can run faster than RDBMS.
If writing to tables will happen frequently and in large volumes, or a good transaction mechanism is required, then I would look at PostgreSQL.

D
Dmitry Maslennikov, 2017-04-01
@aprenoir

If not HighLoad, then opt for classic MySQL. And from the advantages of MongoDB, I note that it supports horizontal scaling (sharding) and load balancing at the base level.
It makes sense to move to MondoDB if you already have at least a separate server for the database. It is much more gluttonous than MySQL.

E
Express777, 2018-05-18
@Express777

10 messages? Epta, why do you need a radish. Why raise a separate service, configure it. Create a table in MySQL with the Memory storage subsystem, which also stores data in RAM and is super-fast because of it. And read, write from there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question