Selecting database: Always done MySQL but thinking about Redis or Mongo

I am Selecting database: Always done MySQL but thinking about Redis or Mongo

The solution is not very relational at all but just storing documents. Could be MySQL, could be MongoDB och Redis but which one can take the highest number of connections from an API? I am thinking about having 20 webservers in a loadbalancing config. If we are talking about 100 users saving the same amount of json data which one can handle the most reuests?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

I recently came across a repository on GitHub with some benchmark results.

You can take a look at the repository here:

Results from the tests:

With data size in rows numbers:

  • 10 rows
mysql insert: 1702ms
mysql select: 11ms

mongo insert: 47ms
mongo select: 12ms
  • 100 rows
mysql insert: 8171ms
mysql select: 10ms

mongo insert: 167ms
mongo select: 60ms
  • 1.000 rows
mysql insert: 94813ms (1.58 minutes)
mysql select: 13ms

mongo insert: 1013ms
mongo select: 677ms
  • 10.000 rows
mysql insert: 924695ms (15.41 minutes)
mysql select: 144ms

mongo insert: 9956ms (9.95 seconds)
mongo select: 4539ms (4.539 seconds)

@ivanpopelyshev results:

mysql insert: 1214ms
mongo insert: 1401ms
mysql select: 9ms
mongo select: 326ms

mysql insert: 11557ms
mongo insert: 7751ms
mysql select: 30ms
mongo select: 2957ms

ENGINE=‘MyISAM’ for the MySQL tables:

mysql insert: 361ms
mongo insert: 938ms
mysql select: 9ms
mongo select: 345ms

mysql insert: 3394ms
mongo insert: 6985ms
mysql select: 31ms
mongo select: 3080ms

You can also test this yourself too:

git clone
cd mongo-mysql
npm install
node index

Hope that this helps!



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.