Reputation: 22810
im fetching simultaneous data from some api using nodejs. my database is mysql.
INSERT into mysql(tabels) values (values)
the problem is sometimes the api doesnt run nor stop maybe becouse a timeout error(sometimes) or something;
what happens if the we query insert at the same time?
how do you insert hundreds of data async simultaneously from many source?
how do you do it? is there any database like mangodb or anything maybe already built for something like this?
Upvotes: 0
Views: 907
Reputation: 211540
MySQL, like any other tool, works well when used correctly. There's nothing about a large number of asynchronous writes that is inherently problematic, but in your case you will need to benchmark and simulate your expected load to find out for sure.
Generally inserting two or more things at the same time is not an issue. You can always tune your database to respond more quickly by designing your tables to be easy to update, keeping indexes to a minimum, eliminating unnecessary columns, and operating on a fast disk.
Keep in mind that inserting the data isn't usually the problem. It's making use of the data once it's inserted. You haven't really described what your intention is here.
There's no specific reason to use a NoSQL tool here, even if you're doing 10K inserts per second, which a properly tuned and architected MySQL can handle.
Upvotes: 1