2
populah
5y

Hi guys so I have a fairly simple spring boot backend with mongodb. I am starting out with this setup for my app. I dint choose something like firebase because it will lock me into their ecosystem.

My question is can initially just run my backend with Digital ocean droplet or I need dedicated hosting?
Can it be done with docker. Is it the only way?
If not digital ocean then which one? Vultr, hetzner, linode, aws lightsail?
What are the things needed. Am I missing something?

Comments
  • 1
    I’m in the same boat

    Digital ocean, Linode & Vultr don’t have managed MongoDB instances so it will be something you will need to configure, secure and backup manually

    What’s your backend written in?
  • 1
    @err-occured java(spring boot as I mentioned)
  • 1
    It can be done with docker as far as I’m aware, and you could run it on a compute instance. Unfortunately as I haven’t used aws, I wouldn’t be sure
  • 1
    @err-occured and mongodb can run inside docker right? I am only worried about the security of the backend.
  • 1
    @populah yeah, there are official images available and instructions on how to secure it. So as long you block the mongo exposed ports to the world and you set a really secure password, you should be fine
  • 1
    @err-occured what about the api keys and ports to springboot instance running..?
    What are you working on?
  • 1
    You can host the mongo on aws or azure and buy a cheap vps for the actual backend code
  • 1
    @yellow-dog how about using mongo atlas?
    And why can't i use mongo in docker along with spring boot?
  • 1
    A bigger vps usually costs more than what i said.

    Idk what mongo atlas is, in case its a cloud mongo provider, then substitute it for the other two cloud mongo providers i said.
  • 1
    @yellow-dog the 5$ initial setup cant cut it?
    Atlas is by mongo.. Instance hosted on aws, gc or azure. Check it out if you wish.
  • 0
    You can totally use DO with docker images and even a mongodb container, just be sure to persist logs and data to a disk.

    Not sure why'd need a dedicated host for that, nothing wrong with a vps.

    You could also run your application (container) inside azure and get a dedicated managed db from there, what are your requirements?
  • 1
    @alexbrooklyn i dont have much requirements.. Just a spring boot embedded tomcat + mongodb. What else will i need. Do I need nginx?
  • 1
    @populah you would forward ports through docket, as for api keys and spring boot, I’m not to sure.

    My app is currently private atm, but it fakes within Organization/ Productivity category’s
  • 1
    @err-occured you used laravel?
  • 1
    Yeah, don’t mind it
  • 1
    @err-occured did you check mongodb atlas or mlab? For managed db?
  • 1
    @populah I’ve heard of atlas, but not mlab, however I would prefer to try and keep everting within the same infrastructure to avoid network delay
  • 1
    @err-occured but I dont think any one else has managed db like them..
  • 0
    @populah sure put an nginx in front, it can add some common headers and cache some pages
  • 0
    Maybe this is for you?

    Instant GraphQL + MongoDB Backend With Mongoke

    https://hackernoon.com/graphql-mong...
  • 0
    @heyheni i had tried dont eant to get into grapgql
Add Comment