MongoDB Atlas & Node.js

This may sound a bit naive, but here goes. Assuming I am using MongoDB Atlas on AWS. This sets up a VPC for Mongo. Takes care of a lot of internal work as well. No problem there. Now assume I need and require a Node.js server somewhere in that scheme. Where does this Node.js server go in the scheme of the VPC for Mongo?

If I had used an Amazon NAT Gateway setup I know exactly where my entry point is, (Gateway), Node server(s) are and then Mongo servers. But in the Atlas configuration I am really confused as to how to connect a secure Node.JS app running on a server to the Mongo VPC.

Can anyone just clear up the architecture layout for me?

Atlas documentation deals with Mongo. Almost all the stuff I saw on the Net deals with local Node programs or using Docker (which we are not using atm.)

So am confused where this Node.Js server would go as it also needs to be replicated into zones etc.

Do I set up a NAT Gateway by myself then apply Atlas behind that Gateway on my VPC? or do I set up Atlas first then hook into it from a server I set up in Amazon?

Sorry if this question seems dumb, but this has really stumped me.

Thanking all in advance

Atlas is just the DB, nothing more nothing less, so your app and anything connects via MongoDB drivers and you then whitelist the IP of the app server in the settings on Atlas (it should be near the place where you get the connection address). There isn’t any other way that I know of to put node.js or anything else on there.

1 Like

@storyteller ty for your answer. It is exactly what I thought. Atlas then demands two setups. One for Atlas, and one for your actual server app. Whereas the NAT gateway if done by myself would demand one installation, though Atlas does take care of a lot of the headaches. Thanks so much for the answer.

1 Like