Hi @tukaram_bhosale & welcome!

I believe this reference should help you understand the use-case of an in-memory database: In-Memory Databases Explained | MongoDB
As a quick summary:

The main use case for in-memory databases is when real-time data is needed.

Before going further, I think it’s important to note the following:

If you are ready to give in-memory databases a try, you can give the in-memory storage engine with MongoDB Enterprise Advanced a spin or use MongoDB Atlas as a persistence layer alongside any other in-memory database.

Your need for the high performance (and cost) of an in-memory database may depend on your exact use case or requirements.

With regards to caching, you can explore using Redis for caching alongside MongoDB for persistence. Here’s a reference that compares between the two: MongoDB Vs. Redis Comparison: Pros And Cons | MongoDB