Should choose which database to store data with nodeJS

  • Hi Everybody,
    Current, I do not know choose type of database to store data with bif users visit ( Mongodb, mysql, Redis, PostgreSQL).
    My website use mysql to store data but it become slow and some time have error from data with complex queries.
    Thank You.!

  • General answer: It really just depends on the data structure you have to store 😛
    What do you mean with "to store data with bif users visit"?

  • @Giggiux sorry I have a mistake, website have big traffic.

  • Community Rep

    Your question is too vague. You should read up on the advantages and disadvantages of each database.

    In general, I would recommend Mongo for NodeJS apps. I find it is easy to work with, has great tools, good documentation, and is very fast. If you want raw speed, Redis will usually perform faster than Mongo, if you take the time needed to learn about it and properly configure it. I would avoid SQL databases for NodeJS apps; their highly-structured language isn't conductive to the Node ecosystem.

  • @Duy-Hồng said in Should choose which database to store data with nodeJS:

    @Giggiux sorry I have a mistake, website have big traffic.

    That doesn't really help. This is really a question for your developers, they will know what they need.

  • @Duy-Hồng also, you are asking this in a NodeBB focused community, not a development, database or IT community. While loads of people here do have the experience and knowledge that you might need, this is not a community meant for this kind of information. NodeBB works with Redis and MongoDB. No one here will necessarily have any other experience to share with you.

  • Admin

    In general, we recommend MongoDB if you have a large community. Redis will work just fine, although the memory usage does scale up over time as everything is stored in-memory. Just something to consider.


| |