2 ms·
Even if you use mongoose, you still need to make sure that a connection is successfully made to the database before you try to start using it. This is a blockin
by latchkey 14y ago
Even if you use mongoose, you still need to make sure that a connection is successfully made to the database before you try to start using it. This is a blocking operation. The problem is that by default some node libraries (cough redis cough) will cache requests in memory and execute them once the connection is made. This is terrible because if node dies (for example, if mongo fails to connect), all that data is dead.