i have a series of scripts that a writing to a single mongodb just using pymongo with no orm but after some time the data seems to disappear from their respective collections. The scripts start like four instances of themselves at reboot and wait three minutes before starting to run queries to the database. Sometimes the data randomly comes back and disappears again.
I have tried several approaches to fix the issue but it has the same results. These are what i have tried so far
1. Open one connection every time you want to query the db and close it afterwards. That didn't work because i run out of sockets
2. Open one connection for every instance of a script that is started and never close it. But i read someone that that can also be the issue because the connection that remains open for too long can also cause that issue. That also produced the same result. i should mention that the scripts run continuously till the system goes down or they are killed
The scripts are python 2.7, pymongo 2.*, mongodb 2.4.9.
However the frontend team is using node and mongoose to access the db.
I really need help and have been stack with this problem for a week now