function dbQuery(sql)
{
dbcon.query(sql, function(err, result) {
//imagine the PING to DB server is 1 second.
//It would take 100 seconds to complete 100 Queries, if the query is run 1 by 1.
});
}
for (var i=0; i<100; i++) {
dbQuery("INSERT INTO table VALUES some values");
}
I am running a Socket Client to get continuous streaming data, and I need to feed the remote database in real time. However, current design of executing query is sequential.
Imagine a PING to remote MySQL server is 1 second. It would take 100 seconds to complete 100 queries.
I need 100 queries to complete in 1 second without waiting for the result. Meaning just "push to DB server and forget about it", and ignore the delays between Network.
If this is not possible in NodeQuery, it is possible to use other programming language to get the desired results ? EG Java, PHP, Python, something else?
Note: I need to execute each queries in real time. Sending by INSERT by batch is not an option. I need to feed database instantly when I get the data from else where.
- Non-blocking, non sequential
- Simultaneously, Concurrently, Parallel