I'm shocked to hear more and more people running an HTTP api from a $5 DO instance. It's enticing enough for me to learn, but I want to know, what makes golang so scalable?
I love the idea of just serving a production HTTP API from a single go file.
It's not DO. It's scaleway C1 arm server, even cheaper.
Golang produces native code with very good runtime with green threads which makes it very easy to do async programming and write efficient network code. But language won't save you from inefficient algorithms and dumb code of course.
> I love the idea of just serving a production HTTP API from a single go file.
You may have mistaken by single Go file in my service but it is actually a lot of code included spread across several libraries.
In order to write this service I had to write my own open graph library, oembed library, html parsing library etc..
It is running for more than 2 years now, never failed :)
Golang is pretty stable.
Also the server is behind Cloudflare which caches responses and protects from DDoS, this can be another reason for low RPS to the server.