Hi @here Can I use my local MongoDB for developm...
# help
v
Hi @here Can I use my local MongoDB for development with SST?
a
if you’ve dynamic dns and port forwarding set up you can. Basically, your mongo instance needs to be accessible by the internet. You could also use mongodb atlas, they’ve a decent free tier.
t
I'm not sure this is the case, I use a local postgres fine. Ultimately the code is running on your machine
v
Thanks for the reply @Ashishkumar Pandey Basically the problem here is, our local MongoDB data itself is couple GB's which mean, we can't use the free tier of Mongo atlas (for multiple devs). And it's not just the case of MongoDB right, for other databases also people will face this issue. I'm curious to know, why do we have to do port forwarding here. I don't know the full architecture of SST dev environment. But as far as I know, the lambdas are still running in locally with the support of a websocket based proxy technic. That's why we could do the breakpoint based debugging. So if my above understanding is true, we must able to connect to a local running MongoDB from the local running lambda without port forwarding, right?
t
Yeah you're correct in your understanding
a
How would the stack connect to the local instance when deployed? Doesn’t the db instance needs to be publicly accessible for that?
v
@Ashishkumar Pandey production or other deployed stages, we will be using MongoDB atlas, here I'm talking about local dev environment
a
okay, I get it now. I thought you wanted to use a local db with the API deployed in the cloud. Yes, @thdxr is correct, local connections work fine during live lambda development. I’ve been using local dynamodb myself for the same.
v
Ok. Got it. Basically, we are facing some issue with local mongo connection, must be something else. We initially thought it might be an issue with SST. That's why the message. Thanks a lot @Ashishkumar Pandey and @thdxr for the clarity.
a
No worries. 🙏