Search code examples
herokudeploymentcloudvpsmongodb-atlas

Do I need MongoDB Atlas if I have Heroku?


Can someone explain me why we need the Atlas? If I have Heroku which gives an easier access to cloud (PaaS), then why we need MongoDB Atlas? Some sources say that we can connect Heroku with Atlas, but why we need that? And can please someone explain me the difference, because it seems I do not understand it completely.

Will be very thankful to everyone. Articles will also be good.


Solution

  • Heroku is a PAAS where you can deploy your applications. Multiple languages are supported and the development experience is great (deploy from Git or using Docker, plenty of examples and documentation).

    Typically your application needs a data store to persist the data, Heroku offers few options (ie Postgres) but no more MongoDB. An alternative is to use Atlas where you can define your MongoDB cluster and databases.

    Both Heroku and Atlas have a free-tier so you can run both the application and the database without cost. As your database grows you might need to buy a different subscription, this applies to Heroku too if you require more resources or for example no downtime (Heroku Free tier sends the Dyno to sleep after 30 min inactivity).

    A good article to use Heroku with Atlas is Detaching from mLab