Member-only story
I Built Two Identical APIs in Go and Rust. One Cost Twice as Much to Run.
The cloud bill landed in my inbox and my first thought was that finance had made a mistake.
Two services. Same endpoints. Same database. Same traffic, down to the request count. One bill was nearly double the other.
I read it three times before I believed it, then I opened my laptop, because a number like that does not let you sleep on it.
If you have ever shipped the same idea in two languages just to compare them, you already know the itch.
If you have not, stay with me, because what I found was not what I expected, and being wrong about it taught me more than being right ever would have.
The Setup
I built a small order-processing API twice. One version in Go, one in Rust. Same routes, same schema, same load test hitting both with identical traffic for weeks straight.
Nothing exotic. A handler reads a request, validates it, writes to the database, returns JSON. The kind of API most of us write without thinking twice.
func createOrder(w http.ResponseWriter, r *http.Request) {
var o Order
if err := json.NewDecoder(r.Body).Decode(&o); err != nil {
http.Error(w, "bad request", 400)
return
}
if err :=…






