1. 4

Hello everyone, I need to deploy a web application (static frontend + backend in Go + PostgreSQL + Redis + long running tasks) for a web application that need to be up for a limited amount of time (3 days at maximum). What do you suggest? The app is still not ready for K8S, it’s using docker-compose.

  1. 9

    Docker-compose on a VPS. Why make it weird?

    1. 2

      Because I don’t want to worry about autoscaling or resource consumption. But maybe you are right…

      1. 2

        You could always benchmark your service to put these concerns to rest.

        You shouldn’t have any trouble generating a few tens of thousands of mock rps (requests per second) on a laptop to see how your service does.

        How many users are you expecting to deal with simultaneously?

        1. 2

          Probably 1/2 for seconds in the onboarding phase and around 10 for seconds for the voting. The voting phase will take 1 hour, so my estimation is made by excess. The more that I think about my use case and the more that I realize that you are right, a VPS should be fine.

          1. 2

            So a raspberry pi would be enough, if one could buy one.

    2. 6

      Fly.io way be a good fit. They have good pricing for small projects (including free Postgres), and deploying is pretty easy. Doesn’t use docker-compose, but I don’t know any off-the-shelf host that does.

      1. 3

        Like friendlysock I would deploy this on a VPS since you’ve already got it running in compose. If you select a budget provider who charges by the hour (Vultr is my personal preference), this can be achieved for less than a dollar.

        On another note, this sounds a lot like a take-home interview assignment. If this is the case, and they’re expecting you to host it at your own expense instead of providing a way for you to do so at theirs, that’s a red flag.

        1. 5

          this sounds a lot like a take-home interview assignment.

          No. It’s voting by SMS application for a local festival. Now a selected jury makes the voting, but everybody is complaining about the outcome every year. So I would like to “democratize” the vote :) It’s a volunteer task.

          1. 3

            Good on you mate 👍

            1. 2

              Another thing to consider if you haven’t already: I’ve seen several demos and launches of SMS things like this that fell over not because the backend couldn’t scale, but because their SMS gateway didn’t – either it couldn’t handle the traffic, or triggered some throttling or abuse detection or something when the live event sent a sudden surge of traffic.

              1. 3

                What are you using to send SMS? I am planning to use Twilio and only to send, every user will get a magic unique link to access the voting poll.

                1. 1

                  I haven’t had this failure mode hit me fortunately! I’m just speaking from things I’ve seen happen or been on the user side of something failing during an event.

                  I have used Twilio, but for only for a very different usage pattern more like one on one conversation over SMS, so never had to deal with these kind of spiky traffic patterns. Sibling’s comment about 10DLC sounds important, but I don’t have much other detail to add.

                  1. 1

                    Ah, you might want to look into 10DLC and see if it applies to your use case. Telcos hate people sending URLs.

                    1. 1

                      Thank you for this advice. I will investigate about it.

            2. 2

              If I were doing what you describe, I’d stand up an Ubuntu VPS on either Linode or Digital Ocean. Both companies sponsor many podcasts and will give you a $100 credit to use over 2 months. That will be more than ample to get this done for free. Their $60 16GB/8 CPU/320GB SSD plan will be more than ample, and assuming it’s up for 5 days will barely make a dent in your trial credit.

              If you don’t already have a podcast you like that offers the referral code, I enjoy but am not affiliated with Coder Radio and their Linode referral link is at the bottom of that page.

              1. 2

                DigitalOcean App Platform is pretty straightforward, and has static website support too (though I haven’t used that part). They have hosted Postgres and Redis.

                You can probably do it for free using their $100 credit offer, if you’re only up for a few days.

                1. 1

                  deploy a web application (static frontend + backend in Go + PostgreSQL + Redis + long running tasks)

                  There’s no reason to use containers for this. Binaries orchestrated with e.g. systemd are simple and provide a much smaller risk profile.

                  1. 3

                    If you are already containerized, why go back?

                    1. 2

                      I guess I don’t see “not using containers” as “going back”? Easier to write a systemd unit file than a Dockerfile. But YMMV of course!

                      1. 1

                        Less overhead, less risk, less complexity. But that’s all subjective, I guess!

                        1. 1

                          But not less work, if it’s already in containers.

                    2. 1

                      Another option if you want to stick with docker-compose: Azure App Service has preview level support for running multi-container apps directly from your compose file. https://docs.microsoft.com/en-us/azure/app-service/tutorial-multi-container-app

                      It’s likely more expensive than most of the other options listed, but does get you out of the business of a lot of the management and scaling work. I haven’t used the multi-container support, so not sure how solid this is now, but did use the initial docker support in production for several things since its preview window with mostly good results.

                      1. 1

                        This is great. I will make a test. Thank you for the hint.