What's the best place to host a go webapp

Good afternoon,

I am going to start a new project, with the api/backend in golang. This is sort of a business listing/social network/marketplace all mixed.

I am trying to figure out the best infrastructure to host the project (I just opened an account on digitalocean with 10$ discount) and easily deploy it. I am not a devops at all, so the cheapest and easiest solution would be the best. I am also trying to choose the most appropriate database technology, most probably picking one from postgresql, mongodb, orientdb or arangodb.

Some insights?

You could always start out on IBM Bluemix. There’s a free tier which will likely easily handle all your development needs, and you can use a Cloud Foundry Go buildpack to get the very latest version of Go. PostgreSQL is available as a “labs” service, along with MongoDB and all the others.

Once you’re set up, deploying is a single command.

I highly recommend embedding your app in a docker container and orchestrating with docker-cloud.

Although it is a little bit more to learn, once you have it setup the ease of deployment and redeploying updates is, IMO, as easy as it gets. Also having everything setup using containers allows you to change providers based on your future growth and needs easily.

Example.
A few months ago we moved all company services running at Softlayer to Digital Ocean in a couple of hours, with zero downtime.

Hope this helps :slight_smile:

Thank you for your answer. I hear everybody talking about docker …
Here is what I understand docker is: it wraps together a “virtual” os, as well as dependencies (a database for example?), Setting (through environment variables) and your actual code …
This let’s us be sure that the thing we created on our local machine is going to be run exactly the same on production machine ( cloud? )

Is that it?

  • is the actual data from the db stored with A docker image (for a mongodb image for example) ?

I think the best way to explain is by reading their What Is Docker? Page; the second image/section explains it best.

basically think of them as lightweight VM’s that require no OS themselves running on top of a host.

there are many other benefits like you had mentioned about local vs development environments being the same, there are also other benefits, especially in their latest release, about orchestrating your app, load balancing…

As for the DB you can store the data in an image, however it would be volatile and data be lost when the container is removed. So I would say the standard approach is docker allows you to map a directory from your HOST to your CONTAINER and then the real data is written to the HOST and will persist in spite of the container.

There is so much too it, even I don’t know half of it, but think it’s well worth learning.

1 Like

Amazon AWS offers a t2.micro instance for free for 1 year if you register.

Thank you for these answers.

As joeybloggs suggested, I will dive in docker to see this in action. I heard about coreOs so I’m going to experiment with coreos on digital ocean and docker containers for the db (mongodb initially to deliver a minimum viable product fast). Then am I supposed to put the app logic for the api in a docker container also? What about a firewall or any other security protection to prevent anybody from accessing my digital ocean droplet ? Do I need nginx or something, or simply use net/http for server and connecting the droplet to a domain is enough?

Do you guys have examples of apps running on a 5$ droplet to see what performanced I can expect from it?

Thanks

I have an app running on a $5 Ocean Digital droplet. I have 140 users, but I seldomly have 3 logged at same time.
Its online for 4 monthes, I serve over net/http (I will use caddy after I have some free time to deal with it)
I have a complex report, that is generate a 100~200 pdf pages, that is usually delivered in 1~2 seconds.
In my droplet is running my go app and a mysql server.

So far I am using 3% of server resources

first of all the hosting solution depend of how much money you want to spend on and what Linux skills you have. you can host yourself the server or you can pay a service. both have advantages and disadvantages.

second to chose the database you must ask yourself what you do. if you use many sql queries and joins maybe a sql engine is better otherwise you can use a noqsl engine.

containers are ok but those are implementaton details. you must analyze your needs to take the right decision. also consider the scalability of your project and your database.

You can run Docker containers on Bluemix too.

Honestly, if you’re not comfortable with Ops work, App Engine, Heroku, or a similar environment may be your best bet. They take away a lot of the harder parts of Ops, if you’re willing to make concessions on certain things.

Checkout Pivotal Web Services. It’s very affordable for go apps because they bill per mb of memory.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.