Hi there!

I’ve set up a Droplet with Node and Vue running on it. In front there is a reverse proxy (nginx). It works fine so far. Now, I want to set up my database with MongoDB and my Redis that stores invalid tokens and remembers consecutive failed login attempts.

I wonder whether it’s smart to put MongoDB and Redis on the same Droplet and put a reverse proxy in front of them as well? The expected traffic is not tremendous.

Thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

Hi @Effection,

I’ll cling to your words the traffic not being much and as such, I think it’s okay to put MongoDB and Redis on the same droplet. Please note that increase in traffic might force you to actually need a separate droplets for both services apart from an upgrade as well.

Generally speaking however, the above scenario shouldn’t happen in the near future except in the case of your application increasing traffic daily.

Regards,
KDSys

  • Thanks for your explanation.

    Do you suggest using Docker in order to deploy my whole application? I was told that Docker can be an elegant solution.

    What are your thoughts?

    Thanks!

    • Hi @Effection,

      If you’ve developed the application already using docker, then yes. It’s really useful and can help you evade any issues related to the difference of the environment.

      If you however haven’t worked with Docker and have to learn it from the beginning, I won’t recommend it, unless this project is not that urgent and can wait until you learn all the required stuff.

      It’s really a 50/50 situation. Depending on the situation you are in, you can choose either to use it or not. Here, I have to say It’s considered best practice and people have been using it consistently the past years.

      Regards,
      KDSys

      • Hi KDSys!

        Thanks! Indeed, I would learn Docker from scratch and we are very keen on taking the project online as fast as possible. I will take the “non-Docker” approach for this version and let time pass :-).

        Another question:

        Do you have any suggestions regarding this architecture:

        Droplet 1: Nginx as reverse proxy and behind Vue/Nuxt and Node. Nginx uses port 443 and Vue and Node 3000/8080. Can they both be configured as “localhost” due to the fact that they act in their own network?

        Droplet 2: Nginx as reverse proxy and behind MongoDB and Redis.

        How can I secure the communication between Droplet 1 and Droplet 2? Is HTTPS enough here or should I consider additional ways?

        Droplet 1 and Droplet 2, apparently, form my whole application.

        Thanks a lot for your answers!

        • Hi @Effection,

          Looking at what you are aiming to install I don’t have anything else to add. Everything looks pretty good for now.

          As for the secure communication, I’ll recommend closing the Droplet 2’s access completely from the world and make it accessible only via Droplet 1. It doesn’t need to have any connection to the outside world whatsoever so it does seem like the proper way to continue.

          Regards,
          KDSys

          • Thanks!

            So I decided to put MongoDB and Redis on two separate Droplets. How can I encapsulate every Droplet to only allow connections from Droplet 1 and 2? Just via the firewall UFW?

Hi @Effection,

Yes, you can use the Firewall to cut of external traffic and allow only from your Droplet 1. It’s the best and proper way!

Regards,
KDSys

Cool, it works! Thanks KDSYs!

Submit an Answer