Data loss issue when hosting MongoDB on AWS server

I have an application that is hosted on a private server with MongoDB, and the data is available and working fine. However, when I try to host the same application on an AWS server, I encounter data loss issues. The data seems to be disappearing or not persisting correctly.

Here are some additional details:

Both the private server and AWS server are running the same version of MongoDB.
I have followed the necessary steps to set up MongoDB on the AWS server, but the problem persists.
The application itself appears to be working fine on the AWS server, but the data just doesn't seem to be stable.

What could be the potential reasons for this data loss issue? Are there any specific configurations or settings that need to be adjusted when hosting MongoDB on AWS? Any insights or troubleshooting steps would be greatly appreciated. Thank you!

what problem, the detail?

what you mean by not stable?

please explain what problem you are seeing.

I have my react application with data been stores in mongodb… But the data getting lost without we do any work on db… Its automatically getting deleted after 12 hours… This issue occurs only in aws ec2… I have the same application running in our private qa server… The same installation method has been followed in both but data is not erased in our private server

Did you find anything related in mongodb log file? if not, you can contact aws support for help. They know more on ec2 related activities.

If should be easy for them to monitor if this issue is stably reproducible.